you will have to know which iphone it is, whether is it 2nd generation, 3G or 3GS.
Regardless of whether you have any of the above iphones you will need to Jailbreak first to install Cydia.
If you are using 3.0 or newer firmware, you will have to download redsh0w software. Just google it.
for steps on how to put your phone into the DFU mode just look into one of the youtube video as it is hard to explain it in here. you will have to press the upper right button (power button) for 2 seconds, then without leaving the power button press the home button for 10 seconds and then let go of the power button and continue pressing the home button for around 25 seconds until you hear sound in your computer, such as when USB device is disconnected.
Redsn0w will jailbreak your iphone. Jailbreak means now you can install any software made for iphone, including cydia. also you can get all the iphone apps sold at itunes store for free. Cydia is installed as part of the jailbreaking process.
now if you have 2nd generation iphone then readsn0w will unlock the iphone for you. just connect the iphone to the computer and run redsn0w again.
however if you have 3G or 3GS then you will need ultrasn0w to unlock the phone. I recommened watching the youtube video as it gives the step by step direction. also the youtube video usually have sotware link also.