I was taught this as "The Principle of Least Surprise" or do the thing that causes the least surprise.
Where it gets tricky is that as programmers we are also power users and our mental model of what we expect to happen and what a user expects to happen diverge, I try to have empathy for the user.
One of my tricks is to imagine what my mum would expect to happen (not because she's a woman, it's not a sexism thing I hasten to add) but because she's a 60yo woman who didn't start using a computer until she was in her 40's and is slightly wary of them still.
If it passes the mum test then I know I'm on the right track.