Play a pitch on the piano that is comfortable for you to sing in the middle of your range. While learning to sing in tune, you should avoid singing in the extreme register as it will only make the process more difficult.
Match the pitch by attempting to sing the same note. Try to lower your voice so that your pitch is just below the pitch of the piano. You may need to continually hit the piano key while you are doing this. Notice how as you go slightly below the pitch, interference beats start to sound between you and the piano. If you can't hear these beats keep practicing and listening until you can.
Raise the pitch to slightly above the note played on the piano. Notice how the interference beats begin to come back the further you get away from the pitch of the piano. This is how you know that you are singing sharp. Practice this exercise for five minutes each day to improve your pitch.
Play the music you are having difficulty with on the piano while you sing. Try and match each pitch of your song to the piano. By using a piano to keep your pitch in tune, you will be learning how to stay in pitch while singing.