Where are you getting the iPhone 4 from?
It's going to depend on what firmware version the phone is running and what baseband it's on.
Anything below 5.1 is good, so 5.01, 5.0 etc. There's no jailbreak for 5.1 right now
Then you'd have to unlock using UltraSn0w. The baseband HAS to be 01.59.00 if you're on 5.0.1
There's a whole list of what works and what doesn't so I have to know what firmware and baseband it's on.