K first of all u need to understand how scales and melodies relate to each other.
Lets use Cmajor as the scale. To create a melody you would do a key progression only using the keys in Cmajor scale. You can do C E F G- back to C, with what ever rythm you want. I went from 1st note to 3rd note to 4th note to 5th note and reapet. that a very simple melody but it has a very importatn concept when creating melody. Tension and Release is the concept of creating tension so the listener feels uneasy and then releasing tat tension so they feel relieved. The tension that i created in this melody was going higher and higher with notes in the melody, from 1-3-4 and then 5. I then relase the tension by going from 5-1. In the major scales going from the fith note to the 1st note is called perfect candance, which releases all the tension. It is the most perfect tension release you can do. When you go to church and hear then sing they end songs with AAAAAAHHH which create alot of tension and then release that tension with MEEEEEEEEEEEEEN. AMEN is a perfect candance going from 5-AHHH to 1-MEEN. Use this concept to create melody. Just like everything in music this is not a set rule is a guide line.
Now chord progression are related to scales the same way that melody are. On the above melody i will create a chord progression. A chord is the paying of 2 or more keys togerther. When u have a scale u want to write a song to, you can only use the notes in that scale to create the chords for your chords progression. for the above melody i going to create a 3 chords chord progresion.
chord 1 CEG, chord 2 FAC, chord 3 GBD.
Im going to create tension going from chord 1 to chord 2 and releasing wit chord 3 back to chord 1. Agian this is not set in stone you can do whatever u want as far as chords. you can even have a chord with notes that are not in the scales as long as it sounds good who cares.
I suggest you pick up a complete idiot guide to music theory, and a complete idiot guide to music composition. It will help you understand music theory and applying music theory to composition.