The best way to do that is having a good read on your opponent. For instance, you have AA and are playing against a aggressive player who tends to 3bet all the time to steal blinds when he feels weakness in other players hand. You never should shove against him. Let he thinks he is dominating the hand and make a min raise. Normally, if he doesn't shove preflop, he will 3bet, and you just call. This game will probably ends in a All In.
Well this is just a exemple, but in fact, all depends the way the villain plays, stacks and position.