I'm sure we've all had the experience at one time or another of rushing to get the stain on a project and just when all looks great, the scratches left behind from hand or machine sanding come alive to remind us that more work needs to be done before staining.
Needless to say, sanding out the scratches that are made visible, along with sanding out the stain, is no fun indeed. A good way to avoid such frustrating circumstances is to be methodical in the way all is sanded. Here is what I do to avoid this setback.
If the piece is being made from scratch, after all the cut list has been made, I sand all of the pieces before assembly starting with 150-grit paper for hard woods, then moving on to 180-grit and finally to 220-grit. Follow the same procedure for soft woods, but skip the 150-grit.
After assembly - here is the most important part - I dampen the piece with water, section by section, to search for obvious scratches or glue marks. If any are present, I let the piece completely dry and sand those areas the same way as before.
Now that I'm sure all of the obvious glue spots and scratches are taken care of, I then dampen the entire piece, let dry completely and sand the entire piece again with 320-grit paper.
NOTE: This approach is for new work. Restoration techniques are required for previously finished surfaces.