Astrophotography for Nikon D5000?

I need tips on how to take pictures of the stars. Could you help me how to setup my camera also? Like what settings are needed.

First thing you need is a tripod. The second is to learn time exposure and the appropriate settings for it.
There's lots of good tips books every where… Look around on line or at a good book store even many camera stores.

It depends on what objects in the sky you want to take.
For a wide field of view, you just need a tripod and exposure not more than 30 seconds.
If you want star trails, you can expose for a longer time.
If you intend to take photos of star clusters or nebula, you will need a longer focal length say 200-400mm. However you can't used ordinary camera tripod. You will need telescope tripod with tracking(to prevent star trails). Or you can use astrotrac or skymemo.