First thing you need to do is to go to Cydia on your iPhone. Once it is open, go to Manage and then to Sources and then click Edit and then Add at the top. Type repo666.ultrasn0w.com and click Add Source and then you gotta go to . . .
Guide on unlocking iPhone 3G, 3GS or iPhone 4 firmware 4.0.1