First, download the relevant firmware that you want to upgrade or downgrade your iPhone to.
Now download TinyUmbrella [ext link]
Make sure your iPhone is connected to your computer and make sure iTunes is turned off
Open TinyUmbrella and select “Start TSS Server”