NSFW can be done on posts by just clicking the "NSFW" checkbox—at least on standard lemmy web ui, I'm not sure about other UIs and apps, but its probably about the same.
Spoilers look like this:
Title
Text
On the standard Lemmy ui the button with an exclamation point (!) with a... diamond? Or what you might call it, around it will paste that code in.