Step 1. Initiate the unlocking process by chatting with AT & T customer service. With in few hour you will get an email with the steps required to unlock your phone.
Step 2. Download and launch the latest version of redn0w (Windows or Mac) and select the jailbreak option.
Step 3. When asked to install Cydia, uncheck the option and check the box marked with option Deactivate.
Step 4. Now connect your phone to iTunes and it will activate with the new unlock and the jailbreak.
This process works on all iPhones except iPhone 4S.
Source: lifehacker