Whether you want to write a memorable hook or beef up a song with a catchy solo, you'll need to know how to make a melody on a guitar. In order to make a melody on a guitar, you'll need to come up with a chord progression, find the notes that correspond with those chords and create a unified blend of notes.
Write a chord progression. This could be as simple as two chords repeated over and over. This is only to build a framework on which you can make your melody. Your chord progression doesn't have to be memorable on its own. Many famous songs are built on very simple and similar chord progressions, such as Ben E. King's "Stand By Me" and The Police's "Every Breath You Take."
Record your chord progression and loop it. Listen to your chord progression over and over. Treat your recording like a karaoke machine and sing whatever melody comes to mind.
Identify the scales that correspond with the chords you are playing. For example, the notes on the E minor scale are E, F, G, A, B, C and D.
Play a series of notes within the scales of your selected chords. Create a balance between repeating notes and variation and keep it short, as an overly-long melody won't work as a hook. Refrain from simply going up and down a scale. For example, your melody might include a series of three successive E notes and a leap up to a C note. This will help you create a melody that is both grounded and distinct.
Stop playing your guitar and hum the series of notes out loud over your recording. Make sure the notes you have chosen don't clash with your chord progression and stand on their own. A good guitar melody will work as a vocal melody.
Keep playing your melody over and over, making changes to notes here and there to make it unique and catchy.
Don't be afraid if your melody has some similarities to other guitar melodies. There are only so many combinations of notes and chords possible.