If I'm using iCloud for restore on my iPhone then what happens?

I forgot my passlock code for my iPhone 4, I read that if you reset your phone, the lock will be gone. With that being said, will iCloud have all my information?

It all depends what information you are looking for. If you used iCloud to backup your data, you can then use it to restore anything you saved inside of it. Therefore, you would need to have had iCloud backup and storage enabled. You should be able to reset and restore your phone using iCloud and your Apple ID.