One way to approach melody writing is to treat the notes — usually the seven notes of the major or minor scales — as if each were a separate character in a stage play. In this frame of mind, you treat each note's entrance and exit as a significant event.
For example, you might start with a single-note soliloquy, and introduce a few more notes one at a time to join the conversation. Soon one of those notes wanders off to start a new conversation with some other notes.
When a note has worn out its welcome in the spotlight, take that note offstage for a while and let a different character lead the action for a while.