Loosen the stem bolts, they are the ones that there are probably 2 of and they go through the back of the stem horizontally and clamp it to the steerer tube.
Then undo and completely remove the top bolt, this is the one that goes vertically down from the top cap down the middle of the steerer tube. The top cap should then just come off.
It doesn't
really matter too much which order you do the preceeding two steps in.
Once you have done those things, you should then be able to take the stem off (leave the handlebars attached). You can then take a spacer off and put the stem on underneath it, you will obviously then have to put the spacer back on over the stem in order to achieve compression*. The steerer tube should come up to past the bottom of the spacer but not as high as the top of it.
Then you can put the top cap back on, and put the bolt that you took off back down through the middle of it, and screw it back into the star fangled nut. This is where you don't want to tighten it too tight, otherwise you will ruin the star fangled nut! (yes I have learnt this the hard way). It's not the end of the world but you will need a new SFN banging in if you do. Once it is
reasonably tight**, then tighten the stem bolts most of the way, then get your handlebars aligned with your wheel, and then tighten them the whole way.
Like I say it doesn't matter which order you UNtighten them, but it DOES matter however which order you do the tightenings in - you must do the top cap bolt before the stem bolts. The top cap bolt is largely to compress the headset initially, and the tightening of the stem bolts is to keep it like that, so if you do the stem bolts first, it will never be compressed enough and will always wobble horribly.
*
However, if you decide you like the stem in its new position, then at some point you MUST take your forks off and cut your steerer tube down by the amount of the spacer you have removed. Failure t do this will result in you being identified as someone-who-hasn't-cut-their-steerer-tube-down-enough.
** I find a good approximate measure is as tight as you can but with the multi-tool straight rather than in the L-shaped position, this is akin to limiting the amount of torque you can give to that of a screwdriver.