Like the previous answers say, mild sedation is usually given, and there is no pain involved.
They tell you to stay near a toilet when you have had your laxative - heed their advice! When you need to empty your bowels in the course of a day, you can hold it in because you can contract your sphincter muscles, and they will hols solid waste in place. The stuff they give you will liquidise everything in your gut, and when it's ready, it will evacuate, and you will be unable to stop it, so make yourself comfy and let nature take its course - again it's totally painless.