Determine the key the melody is in. Often, the melody will begin on a note of the root chord in a key. The root is the triad, the first, third and fifth notes of the key scale. Otherwise, determine if there are lots of sharps and flats when playing the melody. That can uncover a key, too.
Hum or play a counter melody. Make this an accompaniment without as many notes as the melody, and this can establish a bass line (that would be played by a bass guitar or upright bass). Bass lines generally follow the underpinning chord structure of a melody.
Choose chords that sound good following the main notes of a measure. Notes that are held more than one beat tend to be main notes that the chordal underpinning will support. If the melody suggests sadness, try a minor chord (those with a flatted third). If the melody is happy, try a major chord (a major third between the first and second notes).
Use your imagination. Notes outside a simple chordal structure can work. The point is, song creation is wide open. Though a 90 to 10 ratio of familiar to unfamiliar notes is sometimes suggested, chords under a melody are most successful when the convey emotion.