It depends on what you have made with the yarn. For lace I would suggest the wet blocking method, at least for wool or wool blends.
Acrylic is said to block best with steam.
If your piece is not so lacy, you don't need that much blocking, so I would go with steam.
If the knitted piece is the desired size already, and you don't need to stretch it for blocking, then pin it down and steam it.
The ways of Yarn are inscrutable.
I'm NOT a "miss", I'm a lady!