Start by setting a schedule for yourself. To develop the ear, your brain needs daily reinforcement. Without a schedule, your training will fall flat and you will be unable to obtain the skills necessary to identify pitches. Daily practice is required to develop this skill; each session should last between 30 and 45 minutes each day. Avoid practicing ear training for longer than 45 minutes, which will tire the ear and may actually prove counterproductive to your training. The ear is sensitive and responds better to light exercise and routine practices.
Study one interval at a time until you have it memorized. Even if it takes several weeks or months to learn the sound of a single interval, you must study one interval at a time. Doing so will ensure that you do not confuse the interval with any other interval in the musical spectrum.
When studying intervals, the best option is to record them on the piano and then play them back randomly or have a friend play them for you. Having a friend play may motivate you to continue and see the practice through to the end.
Learn intervals in the following order for best results:
1) Perfect octave
2) Perfect fifth
3) Perfect fourth
4) Major third
5) Minor third
6) Major sixth
7) Minor sixth
8) Major second
9) Minor second
10) Tritone
11) Major seventh
12) Minor seventh
After learning two intervals, compare the two and see whether you can identify each interval correctly. With practice, it will become easier.
Study the names of the notes in both the treble and bass clefs. With the notes memorized, you can start to associate note names with intervals. Take a course in music theory to improve your knowledge of intervals. Once you have learned to identify intervals by sound and you know the names of the notes, you can begin to find the pitch in music.
Find the pitch by comparing the intervals of the melodic line and notating them using your knowledge from Step 3. Start with simple melodies, and don't add harmony until you can accurately copy an entire melody with ease. As you build your skills, you'll be able to notate more complex melodies and begin to add harmony. This skill can take several years to develop, so be patient with how you are progressing. As long as you keep practicing every day, you will develop the ability to find the pitch in music.