[subject] + 一下子 + (就) + [verb phrase] + 了
一下子 says something happened all at once – suddenly, or in a single go. It goes before the verb, and since it describes an event that has happened, 了 usually follows. 就 often comes in between.
It can stress how much happened at once, as well as how fast.
As the second example shows, it also works with a negative or a potential form: you can't do it in one go.
一下 goes after the verb and softens it: "have a quick look", "wait a moment". 一下子 goes before the verb and means "all at once". Swapping them changes the sentence.
突然 also means "suddenly" but only that; 一下子 carries the sense of everything changing in a single moment.