Sanding drywall is a critical step. It does the final smoothing of the surface in preparation for paint. Sanding can range from very light for a good taping job to arduous for a poorly done coating job.
As a rule you use between 100 and 220 grit for sanding drywall. The finer grit is for the last coat. There are a number of types of sanders available, pole sanders, hand sanders, sanding sponges and plain old sanding paper. The idea is to have a fairly large flat sanding block. Avoid using sand paper. You can dig grooves in the mud with your fingers. Do not sand to much mud away. Get it smooth and stop. Use your hand to check for smoothness.
Wet sanding and vacuum sanding are ways to try and minimize the dust. See the article 'Dustless Drywall Sanding' for more information. Wet sanding can work for all but the last or final pass. Wet sanding is a misnomer, what you are doing is actually dissolving the mud and getting it on the rag. Be careful that you don't dissolve too much.
There are sanding heads available with vacuum attachments A lot of fooling around but it does help. Using mud with dustless technology is a good idea, especially for patches. The dust is designed to fall straight to the ground without becoming airborne. It is not completely mess free, but it is a definite improvement.
You want your taping mudding drywall repair to be smooth when it is done. Sand the drywall until you achieve the desired finish and stop. Light weight mud is pretty easy to sand. The danger is cutting away too much. Regular weight mud and setting type mud take a little elbow grease.