> I'm trying to play the piano and I can't figure out how to harmonize (is this the right term?) a melody, this is, how to find or decide which chords go naturally with a specific melodic line
This is a challenging task, almost as hard as composition itself! It's easier if you have a matching baseline to go with the melody, since there are often idiomatic chords that can be played with a given bass note. (Such as the famous "rule of the octave", that has you playing root-position chords on the tonic and dominant, and first inversion chords (i.e. harmonizing with thirds and sixths over the bass) in all other scale degrees.)
Of course you could improvise a baseline for your melody and then harmonize that, but this requires a lot of familiarity with the rules of counterpoint.
This is a challenging task, almost as hard as composition itself! It's easier if you have a matching baseline to go with the melody, since there are often idiomatic chords that can be played with a given bass note. (Such as the famous "rule of the octave", that has you playing root-position chords on the tonic and dominant, and first inversion chords (i.e. harmonizing with thirds and sixths over the bass) in all other scale degrees.)
Of course you could improvise a baseline for your melody and then harmonize that, but this requires a lot of familiarity with the rules of counterpoint.