It sounds like your camera is switched into Macro mode (indicated by a small "flower")
The Macro mode button looks something like this:

Look for this button (it may be a physical button, or it may be in a menu). If you press this it generally cycles through the mode of the camera from Macro to Normal/Landscape (some cameras even have Super Macro).
Most digital cameras have a Macro mode that focuses on objects anywhere from a few centimeters away to 2 feet away from the subject. Anything further away and it will be entirely out of focus. Normal mode can focus from about 6 inches to infinity (but these distances change with each camera).
My guess is you were using the normal mode, but then accidently switched into Macro mode.
Check your manual for more help on how to switch the camera modes. If you don't have the manual, most of the major manufacturers have the manual, or a quick guide for their different models on their web sites.
