I think the best way to do it while sleeping is during the day, be very active and do a variety of things. You will go into a deep sleep and you will be able to see things clearly, but by morning you will forget most of it. It is not a consistent thing and it happens rarely, but it is still possible. I know from experience.
The key to astral projection is an understanding of yourself.
To start, I recommend a deep relaxing self hypnosis. Start to slow down your breathing, and get your body feeling extremely heavy. It should take 20-30 minutes of meditation to get yourself in an altered state of mind. From that point, you want to close your eyes and focus on your third eye. You'll start to feel a trembling, vibration, it can even be extremely painful for some but you have to push through it. When you're feeling those vibrations pulse through your body, you want to reach up and project yourself out. It will feel like you're floating, and free the hell out of you the first time. That last fear is the last thing to overcome before shooting yourself out of your body and astral projecting.