I was given my cousins IPhone 4s. I need to factory restart without pass code?

My cousin gave me his old IPhone 4S when he upgraded and he has forgot the password. The power button is broken and it is now disabled. When i connect to itunes it says i need to enter the passcode to continue. Can anyone help me out?

Only way is to enter DFU mode and then do a restore, however entering DFU mode requires the use of the power button. There's no other way to do it, you will have to get the power button fixed first