1. Jailbreak your iPhone 4 first, using the Redsn0w or Sn0wbreeze v2.8b11. Head to this link to do so: Jailbreak iOS 5.0.1 For iPhone, iPad, iPod With Redsn0w 0.9.9b9b For Mac And Windows.
2. Once you've done with the jailbreak business, now launch Cydia that is on your Home Screen.
3. Now add this repo url: http://repo666.ultrasn0w.com, by taping on Manage, and then Source >> Add (add the url here).
4. Cydia will start refreshing and adding the packages of Ultrasn0w, tap on the repo and install the Ultrasn0w.
5. Once, the process is completely finished. You will have the unlocked iPhone 4 in your hand.