“Mae Ni” means “Before Something” and “Ato De” means “After Something”. When using “Mae Ni” the verbs before it must be a Normal Form (ie. Kaku (Write), Taberu (Eat), Kau (Buy)) where the verbs used before “Ato De” shall be past tense (ie. Kaita, Tabeta, Katta)

Example
I have to wash my hands before taking breakfast – Asa gohan o taberu mae ni, te o (arau)araimasu.

After taking breakfast, I have to wash my clothes – Asa gohan o tabeta ato de, sentaku o shimasu

I have to tidy up the kitchen, before changing my clothes – Kigaeru mae ni, daidokoro o (katazukeru)katazukemasu

After changing my clothes, I’ll be going out – Kigaeta ato de, (dekakeru)dekakemasu

Meaning : Asa Gohan (Breakfast), Sentaku (Laundry), Kigaeru (Changing Clothes), Daidokoro (Kitchen), Katazukeru (Tidy Up), Dekakeru (Go Out / Depart)