How do I upgrade my Bitcoin client?

First, you should backup your wallet.dat in case something goes wrong. The file is located in the data directory:

Windows

C:Documents and SettingsYourUserNameApplication dataBitcoin (XP)

C:UsersYourUserNameAppdataRoamingBitcoin (Vista and 7)

The easiest way to open your appdata folder is to press Windows Key-R, then type %appdata% and hit enter.

Linux

~/.bitcoin/

Mac

~/Library/Application Support/Bitcoin/

Then install the new version in the regular manner. The new client should use your previous settings (including the wallet and the blockchain data).
If, by some strange magic, your wallet gets corrupted, just copy your backup into the data folder.