How to completely reset an iphone 4?

A friend of mines gave me his iphone 4 because he didn't use it anymore but it still had a passcode on it and he thought he remembered the passcode but unfortunately he doesn't, how do I completely restart the iphone and erase everything?

1. Go to settings
2. Go to general in settings
3. Go to reset all the way at the bottom
4. Reset everything you want to