How to: Jailbreak and Unlock iPhone 4 on iOS 4.0.1 / 4

Jailbreak your Device: 
Step 1: Open your Safari mobile browser, and navigate to and now "Slide to Jailbreak"
Step 2: It will now go in two continuous processes, just sit back and let JailbreakMe jailbreak your device,
Step 3: Then, it will tell you that Cydia installed successfully on your device as shown in the screenshot,
Unlock your Device:
Step 4: After jailbreaking, press Home Button and touch on “Cydia”
Step 5: Now Touch on “Manage --> Sources”
Step 6: Touch on “Edit” and then on “Add”. Type then hit “Add Source”. Ultrasn0w will be added to your Cydia Source lists.
Step 7: After installing Ultrasn0w, navigate to your Cydia Source list, and search for “Ultrasn0w 0.1-1”, then it will be installed automatically.
Wow, you just got a jailbroken and unlocked iPhone 4, You are free now from Apple's app store and AT&T carrier! Good luck!

Download iTunes 9.2.1 for Windows & Mac
Download iOS 4.0.1 for iPhone