A macro works very simply. Stupidly so. You hit Ctrl - r, and then you perform the action you want. Then hit Ctrl - r again to stop recording. Hit Ctrl - s to save, or if you messed up you can start recording again and try again. Once saved, you can Ctrl - l (lowercase L) to load it at any time and play it again. It's stupid though, so it will do exactly what you pressed previously, no matter where it is or what it's doing. If you're in the trade screen and record a macro, then if you open the military screen and replay it, you might accidentally change uniforms and squad assignments, because the macro simply repeats EXACTLY the keystrokes you pressed previously.
I have a few macros, for building a tower level, for placing beddings, cabinets, and doors on the constructed tower, and for assigning the beds to be rooms. Three separate macros. I've also got a few for repetitive things, like designating 5 Z levels of "carve up/down stairs" and "press e 10 times" for when I'm making pressure plates. I'll soon be adding one that makes a uniform for steel plate armor, although because equipment is never quite identical (sometimes you get high boots, sometimes you get low) it'll still take a little bit of tweaking to fix the odd flukes. This means that every time I make a new fort, I can run a macro for steel plate armor, instead of manually making the uniform again. Really, macros can save a lot of time pretty much anywhere you want to apply them.