자마자

immediately after

Explanation

자마자 is a connective ending meaning as soon as. It says the second action follows the first immediately.

Say what happens immediately afterward

Remove 다 from the action verb and add 자마자: 오다 → 오자마자.

집에 오자마자 옷을 갈아입어요.

I change clothes as soon as I get home.

Put tense or a request on the final verb

Keep -자마자 on the first verb even when you talk about yesterday. The final verb carries the past ending.

수업이 끝나자마자 친구가 전화했어요.

My friend called as soon as class ended.

For a request, put the request ending on the second action:

집에 오자마자 쉬세요.

Please rest as soon as you get home.