My iPhone 4 screen won't lock when I'm in the middle of a call?

My iPhone 4 screen doesn't lock when I'm in the middle of a call, so I end up randomly pressing buttons with my face when I'm in the middle of a conversation and often mute or hang up on people.

Does anyone know how to fix this or reset my phone?

Begin the process, if possible, by backing up the data on your iPhone 4. Do this by syncing the phone (each time you sync, it creates a backup). This lets you save all your data and settings to restore to the phone after the reset.
When that's done, locate the Settings app on your iPhone homescreen. If you've rearranged your apps, locate it wherever you put it. Tap the icon.
Scroll down to the General menu. Tap it.
Scroll all the way to the bottom to the Reset menu. Tap it.
On this screen, you'll be presented with a number of reset options, ranging from just resetting all the iPhone 4's settings to resetting its dictionary or homescreen layout. The factory reset option is Erase All Content and Settings. If you're sure you want to factory reset your iPhone 4, tap it.
You'll see a warning reminding you that you'll be erasing all music, other media, data, and settings if you do this. If that's not what you want to do, tap Cancel. Otherwise, tap Erase iPhone.
It will generally take a minute or two to factory reset the iPhone, but when the process is done, you'll have a brand-new, pristine iPhone ready for whatever your next step is.