For wardrobe holes, I have a little mental list that I'm always on the look out for: some of these are more essential than others (finally found some grey trousers! yay!). When I find a potential one, I try it on & as long as I love it it becomes my 'priority' purchase (i.e. I'll buy it even if it means giving up some other fun stuff to stay in budget). Like MaryK, I have to be careful not to settle for something that's almost there, just because I want to fill a hole. I still do this sometimes, but I'm getting better.
I duplicate favourite item types, like skinnies or full skirts, (in different colours or fabrics) and favourite colours (in different wardrobe items) a lot, because I enjoy having a bigger closet & that works best for my dressing style. Colour & fabric variety is more important to me than silhouette variety. I also do 'upgrade' duplications as I run across better versions of closet workhorses, and then do a one in/one out when I bring the new item home. But I don't buy the same type of item in the same colour/weight/fabric as one I already have & love...I guess I just have a good mental inventory, because I know what's in my closet & what's not. I don't even try those types of things on, because I'm happy with what I already own.
Like Deb, I've generally found if I try something on & really love it, it'll work well with the rest of my closet (I stick to a certain palette and silhouettes, from preference more than anything, but it does make for a cohesive wardrobe). So then it's just a question of whether I love it enough to make space for it! My space (and budget) is finite, so any new purchase I make is essentially limiting future purchases; I ask myself if I can imagine a better version that I'd buy instead tomorrow. As long as the answer is no, I bring it home.
Since becoming an active member, I also ask myself if I'll be excited to show it off on the forum! In the past, I was less picky about fit than I should have been, so imagining the forum's eagle eyes viewing an item helps me be fussier about that in the fitting room. lol