The correct way is to change the cord, not the receptacle.
When you do change the cord on the back of the dryer from a 4 prong to 3 prong you MUST bond the ground and neutral together with a bonding strap. This should be covered in the dryer manual or possibly a sticker attached to the back of the dryer.
>>> For those who say that this is not true or illegal I would like for them to please refer to NEC Article 250.140 which explicitly permits this installation! This also can be verified by a licensed electrician or by visiting a reputable professional electricians forum. <<<
The 3 prong arrangement came about in WW2. An exception was made in the NEC to allow the frames of ranges and dryers to be grounded by bonding to the neutral of the cord. This saved copper for the war effort.
However this exception was not removed until the 1996 NEC code cycle when all new installations were required to use a 4 wire arrangement where the neutral and ground were separated.
The exception was only valid for certain installations. We won't go into that as you already have the 3 prong receptacle installed and it should be installed according to the NEC at the time of its installation.
The 120V loads found in ranges and dryers are very small, just the dryers drum motor and any electronics or light bulbs. So using the neutral to bond the frames of ranges and dryers was not of much concern.
The NEC is NOT retroactive so installations that have a 3 wire circuit are not required to be removed and a 4 wire circuit installed.
So in summary if going from a 4 prong to a 3 prong cord you must install a bonding jumper to effectively ground the range or dryer frame.
If going from a 3 prong to a 4 prong cord you must remove the bonding jumper between neutral and ground, then attach the neutral and ground wires to their respective terminals.
If any of this is confusing or you are unsure please contact a real licensed electrician to install this for you.