Purchase a basic music theory book that explains key signatures and how to construct chords. You can find one in a music store or access the same information online. Chords are built using various degrees of the key signature with the same name. It takes some time to memorize all the key signatures and chord formulas, so keeping a basic music theory text nearby is a good idea.
Determine the key signature of the song. You will see this at the beginning of the song, indicated by sharp or flat signs on the lines and spaces that are sharp or flat. The key of C has no sharps and flats, so there will be no sharp or flat signs indicated. If you see one sharp sign (#) on the highest line of the music staff and a sharp sign on the third space, this indicates the notes F and C are sharp, which makes the key D major. It's important to keep a key signature chart handy because the key signatures provide you with the information you need to figure out the chords for your single melody line.
Look at the notes in the first bar of music. Bars of music are separated by vertical lines that run from the top of the music staff to the bottom. Determine the notes in the first bar of music and find the position of those notes in the scale relating to the key signature of the song. Major chords are constructed using the first, third and fifth notes of the key that has the same name. A C major scale is C, D, E, F, G, A and B. The first, third and fifth notes of this scale are C, E and G. If the melody you want to find chords for is in C and the first bar of music contains these notes, chances are good you'll be playing a C major chord. This isn't a guarantee, but the chord will fit and it's a good place to start. You can figure out chords using this method in any key, as long as you keep a chord construction and key signature chart handy. The formula is always the same.
Understand that one note can make all the difference in the world. If you're playing a C chord and you add the seventh note of the C major scale to the first, third and fifth notes you're already playing, you will change your C major chord to a C7 chord, which will give you an entirely different sound. Listen closely to the way the chords sound against the melody line (typically a vocal line in a fake book) to see if there is any clashing of the notes.
Listen to a recording of the song if possible. Looking at the notes in each bar of music and understanding where those notes fit on the musical scale is the most effective way to determine chords built around the melody line, but hearing a song can help you pick up subtle variations that may not be obvious from the written music. A melody line, for instance, may only be constructed of notes from the major chord, but the actual recording may have the instrument playing chords with an additional scale degree added. Writing a major chord over the melody line would fit, but it wouldn't match the recording exactly.