First, switch your camera to macro mode. Usually, this is shown by a tulip symbol - either on the camera's external controls or on its onscreen menu. Macro mode allows your camera to focus on objects just a few inches away. Turn it off afterwards or your normal photos will be blurred.
There's often a noticeable difference between the image seen through a camera's viewfinder and the image captured. The lens is situated in a different place to the viewfinder and the disparity can cause a ‘parallax error' (a subject centred using the viewfinder will be off-centre in the final picture).
Parallax errors are only a significant problem with macro shots. Being very close to your subject matter dramatically increases the distortion. If there are correction markings on your viewfinder, you should use them. To be absolutely sure of getting the correct composition, use the LCD to compose shots.