How to get my Nikon D5000 to auto focus again?

I've had my Nikon D5000 since last april, and it auto focuses when i hold down the shutter button, but last weekend it wouldn't and i had to manually focus it, which i don't have any problem doing i'd just like to be able to capture a picture quickly without having to take time to focus it right.i've tried to look at all the menu settings and stuff but if you have a way i'd appreciate it.

There should be a switch on the lens make sure that it is switched to autofocus usually shown by an A.

If the switch doesn't do it the lens may have a problem. In that case it'll need professional help.
But, try the switch first.

I'll assume your using the kit 18-55, in that case I like the answers above. If you are not using the 18-55, then make sure the lens is an AF-S Nikon, HSM Sigma, or other lens with a built-in motor.