Melodies are made up of intervals. Intervals are, simply, just a space just from one note to the next. A scale, like the C Major scale, C, D, E, F, G, A, B, C.
If you think of it as a ruler that can measure spaces from one note to the next, that tells you what an interval is. So if I went, 1, 2, 3, 1 to 3 is a major third. If I went first degree to the sixth degree, 1, 2, 3, 4, 5, 6, C to A that's an interval. So intervals are specific spaces and melodies are made up of one interval followed by another interval, and it's good to be aware of certain intervals.
The more you experience them and experiment with them and discover them, the less the serious a melody might be, and the sooner you'll be able to get it going on your guitar.
So, doesn't sound all that sexy, but once you get into it, I think you'll find it's pretty illuminating. So, have fun with that.