What is the make and model number of the camera, please?
Approximately how old is it?
The most common cause of a lens error is something has gotten trapped in the lens mechanism, e.g. a grain of sand.
You can try cleaning around the lens using compressed air or by spraying it with canned air to help dislodge any small particles.
You can also try using a small brush.
However most times it is caused by something deep within the mechanism, and the only way to resolve the problem is to disassemble the camera and thoroughly clean around the mechanism before reassembling the camera again.
If you are unable to carry out the repair yourself, a local camera repair tech can do it for you.