Watch the Melodic Phrasing online guitar lesson by Matthieu Brandt from Songwriting on Guitar
Well written melodies come in phrases and each of those phrases can use stable melody notes and unstable notes in relationship to the background chord.
Together with the harmony,a melodic phrase as a whole might sound open ended or closed. With these phrases you can create question and answer motifs. These phrases can have a symmetric or asymmetric structure and a general direction up or down in which it flows.