think about things like
a) contour - the overall shape of your melody, where it goes up and where it goes down and why - this is not altogether different from considering the arc or form or energy level of a whole piece, things like singular high points can be very exciting if you lead into them, and are well-placed towards the end of the whole phrase; hanging out around one pitch or range of pitch for a long time gets stale; a mixture of stepwise motion and bigger leaps at key points tends to work well. these are not Hard Steadfast Rules Where Only The Good Melodies Do Them but are helpful things to internalize as you explore building your own unique melodic sense
b) phrasing - when to leave open space to breathe, when to reuse a pattern and when to break from it, and how all that relates to the rest of your arrangement (or consider altering the arrangement underneath to support your phrasing)
c) motifs/licks on a base level. if you start with a small chunk of a few notes that sound cool, reuse that chunk to develop the rest of your melody - spin something slightly different using the same (or nearly same) rhythm, use new notes in a similar series of intervals (this is called a "sequence"), basically whatever you introduce along the way can be reused to develop the music further, which ends up doubling as cohesion and as "justification" for doing the cool thing in the first place
write with intentionality - mean what you put on the page! or screen! or whatever!
the "singable/hummable" thing can be helpful, i agree. you don't have to start with melody first always or anything like that, but it's good practice to start songs with different things on different occasions, and i find that Melody First produces a somewhat different kind of result, because then once you have your nice melody you get to focus on what to put underneath it, so the arrangement ends up being more informed by that and can come across as more delicate and well-thought-out. that doesn't mean you need to do that to write a good melody tho.
studying and transcribing others' melodies and considering why certain moments feel so effective to you will also be helpful