You have to call Canon and get it repaired. It might not be worth it.
How would you check it for a piece dirt, or foreign debris?
Those inexpensive "point and shoot" cameras are nice, until something goes wrong with one of them. Unfortunately, that is when people discover that the cost of labor per hour [$200] is more than what they paid for the camera. They begin to realize that their camera is really just a fancy disposable camera.
If the camera has a lot of sentimental value, you might try a place called Cameras and Parts. I used them to repair my PowerShot G12 for the lens error and a flash error. They did a great job. You can google them and see if your camera model is on the list of cameras that can be repaired by them. However, keep in mind that the cost could approach the value of the camera. You did not mention which camera model you have.
I am assuming of course that your camera is out of warranty. If it is still under warranty, then contact Canon for repair work.
09/26/2023: New firmware updates are available.
08/18/2023: Canon EOS R5 C training series is released.
07/31/2023: New firmware updates are available.
05/31/2023: New firmware updates are available.
05/18/2023: New firmware updates are available.
03/30/2023: New firmware updates are available.