iOS 4 hits the iPhone today - here's how to get it
Once you've got iTunes up to date, plug in your iPhone in and make sure iTunes is open. This would probably be a good time to make a backup of your phone, in case anything goes wrong with the update. It went smoothly for me, but better safe than sorry! You can right-click (control-click on a Mac) on your device in the iTunes sidebar to bring up the backup option.
After that's done, select your device and hit Check for Updates. You should be prompted to update to iOS 4, as long as it's compatible with your device. Happy multitasking, universal-inboxing and more!