How do you unlock a car stereo with no code?

My favorite way is a five pound blacksmiths hammer and a lot of swearwords.

The dealer may have a master code for the stereo, If buying a used stereo always get the VIN (serial #) of the donor car.