what iOS version do you have?
if you need to keep your info on your iPhone, rathere than restoring and reinstalling everything, you would do it with resn0w. if your iOS is 3.x up to 4.0.1 or 4.3.3, you'll find jailbreakme.com very useful.
but if you need a baseband preservation, you need to do it with sn0wbreeze (Windows only) or PwnageTool (Mac only).