The trick is to turn off the flash, sit it on top of something if you don't have a tripod. Then set the camera into self-timing mode (using the built-in timer), and most important of all: put your finger in front of the little photo-sensing iris but without touching it, and push the button to take the picture!
If you have a remote control unit, it is even better. Use that and avoid touching the camera so that your composition is not changed when you push the button to take the picture.