I don't do videos (I keep trying but I keep messing them up) but I know a lot about Music Theory (which is what your going into here). The producer Tune In is a monster in the music theory game and answers a lot of questions like this in the music theory section of the forums. I know it seems like a video would be easy but.... I can try to explain in words.
The basics of modern music composition come down to Rhythm (like a drum beat) Chords (in patterns that repeat called chord progressions) and Melody (one note played at a time played in some type of pattern). You probably know this already but I'm just making sure.
So to answer your question I need to make sure you understand the basics of these three elements, don't trip if you know this stuff, somebody else will get something out of it:
Rhythm as it relates to melody:
Most people (Since the very beginning of classical music including Mozart, Bach and everybody else you can think of) takes a "Dance" or a popular style of Drum beat we'll say (it's more than that but we're gonna keep it simple) let's say a classical composer would say "I think I'll make a Gavotte today" where a modern composer might say "I think I'll make a Trap Beat today".
The rhythm of the melody will have some sort of relation to the rhythm of the Drum Beat and that's pretty much how the rhythm is picked. Sometimes there are specific rhythms that a melody in a certain style is "allowed" (actually "commonly" is probably a better word but I wanted to get the point across in terms of beginning producers) to have.
You just learn this for each style by listening to a bunch of melodies in that style. If you "remake" or "transcribe" (as we old Jazz and old school Arrangers used to say) a beat this will help with this a lot. In fact, not sure there's a faster way to learn it.
Chord progressions as it relates to melody:
So we have a rhythm and we need a repeating chord progression. A common way to do this is change chords every two beats or every measure and start with the chord that is the key.
So if we are in Am a very common thing (but not the only thing you can do by any means) is to start with Am. This is called the "Tonic" or "home" chord. It sounds like the song is starting or ending when you play this chord.
Then we typically play some type of "Sub dominant" chord. The simple version would be to play Dm but we can play any of the chord in that key that has two notes in common with Dm. (If you don't know what these symbols mean there is a chart that is referenced in the front page that lists the notes in these chords and FL makes it really easy to drop these chords in with the chord tool).
Then we typically play a "Dominant" chord, a chord with the most tension that demands resolution in the key in this case E7 let's say. Now we have a chord progression.
This is just a typical pattern and I could write page upon page just on this subject but we'll keep it simple and just say we picked these chords cause they "sounded good" and leave it at that even though there is a theory that "Describes" why these chords are picked so much. We need to play them in some type of rhythm so I'll say two beats of Am two beats of Dm and four beats of E7. One type of notation to write this would be || Am / Dm / | E7 / / / || Now you might ask "why all this time on chord progressions when I asked about melodies"... we are going to answer that question right now.
Using this stuff to pick notes for melody:
The rhythm of the notes that we "pick" for my melody will fit the rhythm pattern of common music styles and the actual notes we pick will have long notes that are from the chord that are being played "under them". So let's make a real simple melody for our chord progression... We'll play... A, D, E . So two beats of a note called A, two beats of a note called D and four beats of a note called E. We can easily see why this sounds good. It is the roots of the chords. Since we are playing notes of the chords each note will always sound good. That's how we pick notes that sound good...
What? OK, fine that is a little simple. Um, how about two beats of C, two beats of F and four beats of G#? These are the "thirds" of the chords and will sound like they have a little more tension.
Want more choices? How about two beats of E, two beats of A and two beats of B. These are the fifths of the chords and they sound a little less "tense" than playing the thirds but not as "plain" as playing the roots all the time. As you have probably guessed by now, you can mix and match these.
This idea of "tension" (we call it "Inside" for less and "Outside" for more in the Jazz world) is very important is when we get into scales (or "passing tones" = notes not in the chords or scales) we use how much "tension" we want to decide on the note we will play.
Scale Tones and Non Scale Tones as it relates to melodies:
So in our case our progression is in the key of A Minor. So our scale is A Minor. So we can use the scale A B C D E F G A. And if I want to play the rhythms in between the changing of the chords I can use other notes from the scale to do that. So if I play A for two beats D for two beats and E for two beats I can "make up" a way to use other notes in the key to get to a chord tone when the chord is changing and use chord tones on "Strong Beats" (beats 1 and 3 in the time signature 4/4) so that my melody sounds "good".
We don't want to "hang" on a non chord tone too long in your melody and you can very, very quickly play notes that are not in the key (say Eb) as a passing tone to add even more tension into your melody. That is how we pick the notes for our melodies.
Follow these rules and make another melody, pretty much that simple. However... if we use the exact same rhythm that is called Counter Point in Classical music and Harmonizing the melody in modern musical styles (I'm simplifying a little to make it easier to understand, yes Tune In, I'm aware of what your thinking). And we use a different rhythm it is called a counter melody. Since we used the chord tones to pick our first melody the next melody will sound good with it and harmony will result if we stayed "inside" (the chords) enough with our melody.
Might be helpful: Chord Spellings in All Twelve Keys Chart
Hope that helps...
Since I didn't do a vid I thought it might be better in the "Theory Section" .