This is how it's done:
Wait till it gets dark. Put your camera on a tripod and set it for a long exposure. You don't need your flash if you just want the writing to show up. Press the shutter release and then, standing in front of the camera, draw something in the air with a small LED torch or a sparkler.
*****Remember: if you are writing words, you'll need to do it backwards so that it's the right way around in the shot!*****
Ok, up till now it's been dark so the only thing that will show on the image so far is the light writing/drawing, nothing of you moving around -unless you've shone your light onto yourself at any point or happen to be doing this near a street light. I prefer to do it in total darkness so I have more control over the light. To get myself in the shot and consequently some of the background also, I do everything as I have described above, but then before the shutter closes I pose and fire the flash to put myself onto the image.
That's it!!! Experimentation is key - make loads and just enjoy it :-)