The first step for putting chords with your melody? Figure out your melody’s key. You do this by counting the sharps and flats.
My melody has the same key (D major) as the chords in example 3, which means they’ll work together. Notice that A is the first note in example 4. We can find an A note in the I chord (D major), the iii chord (F# minor), and the V chord (A major). If you use sevenths chords, the ii7 (B minor7) will also be an option.
Use this process on all the melody notes, then make up a chart of potential chords for each pitch in your tune.
Now that you have your options before you, choosing cool chords for your song is just around the corner.