This requires removing the wheel by releasing the quick-release lever in the axle. In the case of the rear wheel, shift to the smallest rear sprocket first. Small holes can be fixed by glueing a patch. I have never managed to reliably patch a hole more than a millimeter or two in length. If the hole is large, an air bubble will form under the patch and find a way out.
Snakebites require a large patch that covers both holes.
Pump up the tube to find the hole. Let nearly all the air out of the tube again, clean and dry the tube around the hole, and use the sandpaper to roughen the area. File off seam protrusions. Apply a thin coat of glue that is larger than the patch. Apply the patch and press on hard at the center and all around the edges.