Hey echobat!
You can get a custom effect by buying one from the Cash shop for 1000 CP however I believe that slots are full up atm. With the other effects it depends on the effect.
Undead - you can use a curse of the undead on an adult pet in your graveyard or alternatively during the halloween event, this can be achieved in other ways like trick or treating or random events.
Frostlight- You can use a frost light icicle on your selected pet, or now (until jan 10th) during the christmas event you can take your pet to the ice tunnels and it can frost your pet. Keep in mind it must be adult.
Stardust- you use a silver stardust urn or gold stardust urn on your selected pet (depending on the pet) or during the starlight festival (whenever it comes around).
Cosmic- use a cosmic salve on your selected pet, this can be bought from other users or from the cash shop.
I hope this answers your question, if you have any others just let me know ^^