Try reloading the drivers for the optical mouse. Or if it comes with an installation CD, try reinstalling it. Usually works the best.
If it's not an optical, as you stated, try removing the ball from the inside, and cleaning the gunk from inside of the mouse itself. Usually works.