From ModMyiFone - Wiki
iLibertyX is the OS X version of iLiberty, an incredible app built to jailbreak, activate, and unlock your iPhone. It works with 1.0.2 and up, and is extremely easy to use!
All right, lets get started. Download iLibertyX (non-member mirror). You must connect your iPhone to iTunes before opening the app. Don't worry if iTunes says its an unsupported iPhone, etc, just let it see the iPhone.
All right, double-click iLibertyX to open it. It will automatically shut down iTunes and iTunes helper when it runs, so you don't need to worry about manually doing that.
Now you're greeted with the iLibertyX screen. Check whichever things you'd like done. Jailbreak prepares your iPhone for modding, and installs Installer.app for you as well. Activate activates your iPhone by bypassing the iTunes activation process, useful if you are unlocking your iPhone or don't want to use the iPhone as a phone/SMS device. If you have AT&T you don't need to do this since you can activate through iTunes just fine. Unlock lets you use the iPhone with GSM carriers other than AT&T.
Now click the Payloads tab in iLibertyX, and choose your extras. BBinfo installs an app to your iPhone which lets you see which bootloader, IMEI, SIM # and more your iPhone is using. SSH lets you access your iPhone's filesystem remotely. For each one you want, click Download by it. It will then download, and go from being grayed out to being available.
Check the payloads you'd like, and then click Free my 8GB iPhone! NOTE: If you have a different iPhone (4GB or 16GB) it will note that instead.
iLibertyX will then run through a bunch of status reports.
At this prompt, you will see a bunch of text scrolling on the iPhone itself. This is normal. Give it a minute or so.
Still waiting... different screen on the iPhone, which has just rebooted...
Assuming all went well, which it should have, you will now get the Enjoy! message, click OK, and the Free my 8GB iPhone button will now say Success!
That's it - you're done! Huge props to the guys for making this, including the iPhone Dev Team, pepjin, aviegas, francis, geohot, and more.