Most home aquariums are made of glass, although it is possible to find some made of acrylic. The cleaning methods vary slightly between the two as acrylic can be easier to scratch, but even the harder glass is not difficult to damage, especially while in the process of cleaning it.
There is a handful of common equipment offered for this purpose: metal and plastic blades, magnet pairs (one for inside the aquarium, one for the outside), slightly abrasive gloves, etc… Having tried most of these products, I have given up on all of them when it comes to small aquariums. I have developed a strategy which involves cleaning the inside of the aquarium with an old bank card (it does not have sharp edges, so can not scratch the glass like blades can), using acetic acid (vinegar, may damage some acrylic) and a microfibre cloth for water stains. Magnet pairs are the only commercial product I consider to be effective, but only for large aquariums where it is not possible to reach the glass by hand or for aquariums whose inhabitants pose a health risk (for example, fish that carry poisons and predators that can harm humans). The problem with using any scraping device is that if some substrate is caught between the device and glass, the glass is very likely to get scratched.
I start by scraping the algae off the glass with firm downward strokes, moving the card away from the glass between each stroke to avoid catching the sand between the card and glass. Once I finish the first pass, I do a second one across the glass, but only in areas which are well away from the substrate. For the last bits near the substrate, I repeat the vertical motions again. Once the glass is clean, I change the water or let the filter pick up the floating bits. Note: if you leave the water for the filter to pick up what you have just scraped off, make sure to clean the filter within the next day or so, if there was much algae on the glass, as it can become blocked otherwise, which would affect its performance. If I plan to clean the lime scale stains which are at the water level, I drain the water so it is about 5 cm below the stains and a little bit of acetic acid on a microfibre cloth to gently scrub them off, while being careful to prevent the acid from going into the water. Finally, I top-up the aquarium and go over the front of the glass with a little bit of acetic acid and the cloth.