Based on preflop tendencies, you should have a rough sense of what % of starting hands a player can have pf. It helps a lot to be familiar with what top 10%, top 20%, etc. ranges look like. Postflop, I tend to visualize the possible hands grouped into boxes according to what they are on that board. For instance, on a 983r flop, I'd imagine boxes for sets, two pair, overpairs, 9x, 8x, lower pairs, straight draws, overcards, and complete air. I get a rough sense of how many combos of each there are based on pf (for instance, if a fairly LAG player limped in LP, there are probably no overpairs in his range), and then start chucking some of them out as the player does things postflop. Often it's necessary to readjust the boxes; for example, if the turn is a ten, I'd need to think about how many of those straight draws became straights, how many became top pair + draw, etc.
And I'm also careful never to neglect that small probability that an unknown opponent is just bat**** insane