have (one's) head screwed on (right)
To have sound judgment. I'm not surprised that Melissa invests most of her paycheck instead of spending it frivolously because she's always had her head screwed on right.
have one's head screwed on right
see under have a screw loose.