Step 1: Download the latest version of the iPhone Dev Team’s Redsn0w tool for your operating system (
Windows / 
Mac).
Step 2:
 Not a requirement, but it is always good  practice to connect the 
device to iTunes and perform a backup of the  contents. Alternatively, 
users can opt to back up the device to iCloud  if enabled.
Step 3:
 After the backup is complete, upgrade the  device’s firmware to iOS 
5.1.1. Users can choose to either do this via  an OTA update on the 
device, or by plugging the device onto your PC or  Mac, firing up iTunes
 and accepting and installing the update, or by  downloading the iOS 
5.1.1 device-specific firmware file and doing a  manual install through 
iTunes.
Step 4: Download the iOS 5.1 (not iOS 5.1.1) IPSW file that corresponds to the specific device you are using.
Step 5: Locate the Redsn0w download folder from 
Step 1, unzip the contents and run the executable file to launch Redsn0w.
Step 6: Select ‘Extras’ on the Redsn0w GUI and the choose the ‘Select IPSW’ option.
Step 7: When prompted, point to IPSW file from Step 4 (which is iOS 5.1) and select it.
Step 8:
 On the main home screen of Redsn0w, select  ‘Jailbreak’ and then make 
sure the ‘Install Cydia’ option is selected  before proceeding.
Step 9:
 The on-screen prompts will now walk you  through the process to put the
 device into DFU mode. This is a  requirement for the jailbreak process 
to be successful. Make sure to  follow all steps carefully.
Step 10:
 When DFU mode is detected, Redsn0w will  automate the rest of the 
process on-screen before finishing off on the  device. During the 
process, it is entirely normal to see white lines of  text scrolling 
down the device’s screen. When the device reboots, the  jailbreak 
process is complete which should be evident by the presence of  the 
Cydia icon on the home screen.
Since this is a tethered jailbreak, you will have to boot your device  
into tethered boot mode on every restart. You can do this by launching  
Redsn0w, select "Extras", then"Just Boot" in order to boot your device  
tethered.
You are now free to feel extremely smug knowing that you are using a  
jailbroken device, even though Apple have tried their very best to  
prevent it. The setup process of Cydia is extremely easy, with on-screen
  prompts guiding users through the process. After the data is done  
reloading and the Cydia app restarts, it will be ready to use.