How to reboot my iPhone 3GS?

Bought my iphone 3gs second hand. It was on the o2 network when i bought it. After i had it a few months, it needed updating, which i did. After updating, it wouldn't work anymore, and it seems to have gone back to factory settings.
When i turn it on, i have to select language, country, wifi etc, and then it begins to search, but iphone screen comes up with - your iphone could not be activated because the activation server is temporarily unavailable. Try connecting your iphone to iTunes to activate it, or try again in a couple of minutes. If the problem persists, contact Apple Support or apple.com/support - and iTunes screen says - We are unable to continue with your activation at this time. Please try again later or contact customer services.
I have since discovered it has been 'jail broken' before i bought it, and it seems to have reset itself back to Orange network, which it was set as the network when the phone was bought new. I bought an Orange sim card to use in it, but still keep getting the same messages on the phone and iTunes. How do i fix it, or is my phone fit for the bin? Any help is much appreciated. Thanks in anticipation.

Im pretty sure you turn it off. And turn it back on by holding the circle button and the power button

Hold the power button