The melody is the most recognizable part of a song, the part that people walk away humming. The melody is the sequence of notes that interplay with the harmony to give a song its tune. A melody can be made up of long, sweeping notes or a bunch of quick, repeated notes that don't stray too far from one another. The way your melody is shaped will have an impact on the feeling a song invokes. For example, The Beatles' "Yesterday," written by Paul McCartney, is full of long notes and sharp note intervals that give the song its dramatic vibe. The Beatle's "The Ballad of John and Yoko," on the other hand is full of short clustered notes that give the song a more playful feeling. Writing a distinct and catchy melody is key to writing a song that people will remember.
The harmony of a song is important in complementing the melody and giving more shape to the song overall. The harmony of your song should be a series of notes or chords that follow the series of notes of the melody. For example, The Beach Boys wrote songs with catchy melodies and complemented these melodies by singing harmonies over the melodies, whether they be higher or lower in pitch, follow the melody note for note, or go off on a tangent. You can add a harmony to a song either via instruments or voice, chords or single notes.
Rhythm plays an integral role in composing your own music and giving it a certain vibe. For example, you can drastically change the feel of a piece of music by having a drummer play a section in half-time, giving it a slowed down, dramatic feel. The rhythm of your song has an impact on the harmony and melody of your song. If your rhythm is shuffling as opposed to being very staccato, this will most likely change the way your melody and harmony flow. While the melody of a song may usually be the most distinct and recognizable part, the rhythm can also serve as a focal point, such as in rock songs like Queen's "We Will Rock You" and many dance, disco, techno and electronic music songs.