Yes, You need to find the generation of an iPhone before unlocking or jailbreaking it. This is simple and will take you seconds.
Look on the back of your Iphone..
If your iPhone is totally white with a silver apple logo = White iPhone
3G
If your iPhone is totally black with a silver apple = Black iPhone 3G
If your iPhone is silver until 3/4's down and then there a black rectangle shape at the bottom then you have the 2G version iPhone
If you still have problem in finding it out, Visit
HTMLCounter.com this could help you to find out.
Once you have found it out, You can visit
Evasi0n Jailbreak to get the free jailbreaking guide to jailbreak your iPhone. To unlock your iPhone, You can visit
www.WickedUnlock.com to get the remote unlocking service. This method of unlocking is safe, simple, affordable and quick. Good luck mate.