Try removing the battery and memory card for at least 15 minutes. With some cameras, this will reset the camera and might clear the lens error message, as long as something isn't physically broken on the camera.
Check your camera's user manual to see whether it offers a manual "reset" procedure, which may work better than removing the battery. A manual reset could clear the lens error message and make the lens operate properly again.
In rare cases, a battery that is running low on power could have trouble making the lens move. (However, most cameras will give you a "low battery" message well before the battery is too weak to move the lens housing.) Try inserting an A/V cable in the camera before you press the power button, which will keep the LCD powered down as it starts, providing extra power to the lens housing.
Another trick to try clearing the lens error message is to press the power button at the same time you press the shutter button. This is a long shot, but it does work on occasion.
If you recently shot photos in poor weather, such as blowing sand or wet conditions, use a brush, a microfiber cloth, or some canned air around the lens housing to try to clear any debris that could be jamming the housing, preventing it from moving.