There's one piece of good news if you have a stuck latch that won't let you shut the door: At least it's not a stuck latch that won't let you open the door. A handful of things can cause a door latch to get stuck in the open position. Many of these can be fixed by simply disassembling and reassembling the door knob mechanism. Those causes that can't be fixed this way usually mean replacing the bolt entirely. Either way, your process starts by removing the doorknob from the door.
Find and remove the screws that attach the interior door knob to the door. Pull the knob out from the door. Be ready to catch the exterior door knob as you do so -- in many models, it will fall right off the door.
Remove the exterior door knob if necessary. For some models, you'll need to remove a few screws where the handle is affixed to the front of the door.
Pull the door latch out of the door. If it won't come out -- this is sometimes the case with stuck latches -- insert your screwdriver into the latch at the point where the door knobs intersected with it. Use the screwdriver to lever the latch out of the door.
Look over the latch mechanism for any obvious damage, foreign objects or shiny areas where the metal looks like it's been worn down. Clean it to the best of your ability. If the latch is obviously damaged, replace it instead of attempting a repair.
Slide the latch mechanism back into the door. Reaffix the exterior knob and screw the interior knob back into place. Test the latch. In most cases, this should be enough to get the latch working again. If it's still stuck open, replace the bolt entirely.