Select a piece of sheet music for the exercise--preferably something with a time signature of 4/4 and a single melody line. You can choose more complex music for counting as you learn how.
Look at the time signature, the two numbers listed like a fraction at the beginning of the score. The top number tells you how many beats are in each measure; the bottom number tells you which type of note counts as one beat. The most common time signature is 4/4, in which there are four beats per measure, and a quarter note counts as one beat.
Start your metronome, if you have one. Set it to a slow beat pattern, preferably MM=80 or lower. Each click of the metronome is one beat.
Look at the notes in the first measure. Don't worry for now about singing or playing the right notes; for this exercise, you are concerned only about the number of beats. In 4/4 time, an eighth note gets a half beat,a quarter note gets one beat, a half note gets two, a whole note gets four, etc. All the notes in a measure add up to four beats.
Place your finger under the first note. Begin counting aloud "One, two, three, four," with the metronome, moving your finger from note to note as you count through the measure. For example, if the measure consists of four quarter notes, simply move your finger once per beat. If it is a half note followed by two quarter notes, hold your finger under the half note for two beats, and move it to the right for the next two beats. You should reach the end of the measure by the count of four.
Repeat this process through each measure of the song, until you are satisfied that you know the rhythm of the notes.