there are well constructed melodies and there are poorly constructed melodies but no pro melodies
difference between well-constructed and poorly-constructed is down to experience and scale use - if you know how notes within a scale can dictate what should come next, your melodies should begin to become better constructed
in the major scale the 4th note of the scale tends to push down to the 3rd (F\E) and the 7th tends to push up to the tonic/octave (B/C)
if you are looking to move out of the current scale then you can use ideas like
modulate to the next key above (from C to G)
raise the 4th and rise to the 5th (F#/G)
use the tonic and fall to the 7th (C\B)
modulate to the next key below (C to F)
lower the 7th and fall to the 6th (Bb-A)
shift focus on the 3rd and rise to the 4th (E-F)
in the minor these ideas are less binding, though they can still be usefully applied
The melody should be singable. plain and simple. If someone can't remember it by way of singing it then it doesn't have that "pro" quality you speak of. Bandcoach explains the actual nuts and bolts of it.... referring to the tensions and resolutions within a scale.