What should I do if I realize there is a minor error in a paper I submitted?
In order to answer this question, we need to define some magnitudes of errors.

A small error does not affect the conclusions and if the manuscript was accepted as is could be fixed in the proof stage before the manuscript goes to press.

A minor error does not affect the conclusions but requires too many changes to be made that it could not be fixed in the proof stage.

A substantial error affects the conclusions and would require the manuscript to be re-reviewed.

If you have found a substantial error, you need to contact the editor and request the manuscript be pulled from the review process. You do not want to waste the time of the editor and reviewers. A small error can either be ignored or reported to the editor if you think that the correction will help save the reviewers time. Minor errors are the real problem. There is no easy way to tell the editor/reviewer what is wrong, but an unclear manuscript is likely to get negative reviews. I would suggest contacting the editor and explaining and apologizing for the problem.

The real question should be how did you find the error? What are you doing looking at a manuscript after it has been submitted?