I locked my iphone and don't know the password

So one morning I was getting ready for school and I changed my password and didn't practice it because it was time to go to school. So when I came home I tried alot of passwords and over time it eventually locked me out. It said connect to iTunes and I did but it didn't work. (I don't want to go through details of what I did, its basically irrelevant).:I don't want to take it to a shop.

Press and hold the power button and home button at the same time until the connect to itunes logo pops up. Connect your phone to itunes and press restore. It should restore and you will have to set your phone up again. Hopefully you already had it backed up!