Things have a nasty 'habit of not turning out' the way you expect them to. [=things often do not turn out the way you expect them to]
He reached into his pocket for his keys 'by/from force of habit'. [=he did it without thinking because it is what he usually does]
I'm 'not in the habit of' making predictions, but I don't think there's much doubt about who will win this election.
(..) Well, as I said, I'm still... collating, actually. But, uh, I have confirmed that he's got an outer layer of protein polysaccharides. He has a funny habit of shedding his cells... and replacing them with... polarized silicon... which gives him a prolonged resistance... (..)1979 Alien