Plug your iPhone to your Mac.
Start iTunes.
Once iTunes is on, and your iPhone connected to your Mac and recognised by iTunes, press the home and power buttons on your iPhone.
Wait until the screen on your iPhone turns black, then release the power button but keep pressing the home button.
After 5 seconds your iTunes will make a sound, and it will tell you you are on safe mode, to please restore your iPhone. Press restore and 5.1.1 should download and install.
Cheers.