One of several earliest lessons you'll get after proper breathing and posture is how to "sing on key". Originally, all but the most musically gifted singers won't have the normal "ear" for music that lets them to hear when they are on or off key.
Before You Start
Before you do anything, you must make certain your body has been carefully taught how to plan for singing. It's like essentials in sport. Without the ability to mindlessly dribble the basketball, a player will never learn how to crossover or pass.
For most of us, it's just only practice. With enough time singing and listening to your notes, you should manage to develop a strong, regular singing voice on key.
First off, you'll need an instrument. This will offer the reference you need to know notes and sing along with them. Whether you know how to read music or not, you should learn the way to play a few basic scales on a piano or guitar to help with this.
Now, hold a note for a couple of seconds and try to match your voice to the note. At the start, you may not be able to recognize or match them together. To help, get a recorder and start recording each of these sessions. For each note, you should record for at least 1 minute.
Regrettably, there are no secrets to obtaining best pitch. It's all about practice. However, there are certain orders in which to practice. I recommend starting with a simple note, such as C or E and functioning your way up and down the scale from there.
If your voice cannot hit the note you start with, reduce the octave by at least one so you are comfortable. Later, you can work on prolonging your range, but for now focus only on getting the notes you are comfortable with correct.
In time, with enough practice and steady use of that voice recorder, you should have the ability to pinpoint the right note almost instantly, remaining on key during no matter of who is playing the music or what octave it is in.