Make sure you play your instrument to figure out what sounds good.
Follow the below step by step guidelines on how to start writing a melody:
The examples below are in the context of this chord progression in C: I, IV (2nd inversion), ii, V (2nd inversion)
Over the top of your chords, play around with the notes in the chords, specifically the length and the order of the notes.
You may wish to have one, two or even three of the chordal tones above a chord to start forming you melody.
E.g.
OR
Play around with the pattern again and use other notes from the scale as embellishing tones to make it a bit more interesting.
It is easier to make this sound good if embellishing notes are shorter notes than the chordal tones and unaccented.
E.g.
Continue experimenting on your instrument until you have a four bar pattern that you like.
Play it over and over and then record.