Melody is what results from playing notes of different pitches - sometimes pitches can be repeated too - one after the other in an 'organised' way. Melodies are very distinguishable and are often singable.
But rhythm is not just a constant periodic beat. The beat or pulse is like its skeleton. Rhythm is how you inhabit the pulse. Rhythm is what results of combining notes of different durations, sometimes coinciding with the beat and sometimes not. For example, if you can notice in Reggae or Ska music, the guitar or keyboards most of the times play, at times, exactly opposite to the beat.
harmony. Usually, melodies are not just played alone by a solo instrument or a group of instruments playing the same thing. Very frequently there are 'lead' instruments which play melodies (such as the voice, wind instruments, etc.) and, at the same time, others that accompany them doing something else. This relationship between different notes played at the same time is what we call harmony.