Most substrates, sand and other materials:
I do not rinse most of these.
Some: Rinse in tank. Put the material in dry, or dampen it in its bag. Partially fill the tank deliberately making a mess, stirring it around. Siphon out the dirty water. Repeat until the water is clearer, though it does not have to be totally clear. This can be done in a bucket or plastic storage container, too.
When you are ready to fill the tank, put a plate or plastic bag over the substrate and allow the water to run in slowly and seep over the edge of the plate or bag to minimize cloudiness.
Specifically about sand:
If you are using a graded product like pool filter sand, Pebble Tek products, or any of several sand sized substrates available in fish stores you might want to give it a quick rinse, but there is only a very small amount of fines in it, since it is sieved to be all one uniform size. No rinsing works for most of these, just skim the water surface if there are any fines that float.
If you are using masonry sand (around here called Olympia #1) or play sand, then it has a LOT of fines, and you are better off rinsing it away from the tank. You may lose as much as half the material washing away the fines. Note: if you will be throwing away as much as half the product, that means it costs twice as much per pound. Buy the right product to start with. A graded product, anywhere from 30 mesh or larger particle size will have almost no waste.