This might just be the easiest How-To I ever write. So lets get to it! For today, we have 2 options. One is done through your computer, the other can be done directly through your iPhone.
Through the computer
STEP 1: Go here http://blackra1n.com/
STEP 2: On the bottom of that page, click on the operating system that you have (Windows or OS X)
STEP 3: Click the button that shows up, let the magic happen
STEP 4: Enjoy your newfound freedom
STEP 1: Pick your iPhone up, open Safari
STEP 2: Go to http://www.jailbreakme.com
STEP 3: Slide to enter the awesome zone
STEP 4: Win the internets.
NOTE: These methods may not work with certain iPhone OS releases, its always a good idea to see if your version can be jailbroken before upgrading!