When playing guitar, use the chords that the songwriter chose when he/she wrote the song. If you don't know the chords, you can try the following.
1. Look up the chords on Google. Just enter the song name + chords. If the chords aren't in the same key as the melody, then transpose them to match your chosen key for the melody.
2. Listen to a recorded version of the song and try to match the chords by ear. Again, if the key doesn't match, transpose the chords.
3. Look at the note that you want to harmonize with a chord plus the notes that follow. Usually, most of those will be chord tones of the chord you're looking for. So if the note was B, and A, G, E followed it, the chord would most likely be E minor, as three of those notes are chord tones of E minor (E G & B). Use your ear to decide if E minor is a good choice. Otherwise, try to use some closely related chords such as G major.