Moin,
it requires a careful assessment of your opponent, their potential hand range, and your own perceived image at the table, as well as a belief that they will fold. This tactic can be used at various stages, from an all-in pre-flop raise to steal the blinds, to a large river bet when a board doesn't seem to have helped you.
I highly recommend doing this with a large amount of experience instead of a tilt mood.