We bought a wall-hung vanity because we liked the look (the extra visible floor space makes the bathroom appear a little bigger) and because you can easily customize the height and store stuff in baskets hidden underneath. However, they require mounting directly into studs, and the chances of finding them in the right place in your wall are not good. I found zero. The instructions suggest you add blocking between the studs, but this would require removal of lots of drywall, fixing the supports in place and then patching up the mess, which is a real bear. Here's a simple and clean alternative, that has the added advantage that the screws go straight into wood and not through drywall first.
If your wall-hung vanity has a better hanging design, congratulations - you may not have to go to these lengths. I ordered ours online without any info on mounting.
Step 1: Materials and Tools
You'll need a piece of lumber at least as long as the vanity (I used a 2×3 because I had one lying around, but a 2×4 would be fine), a cordless drill, deck screws, a saw (or table saw, or circular saw, or hand saw and chisel), and a drywall knife or saw. Screwdrivers to adjust the brackets. Obviously you need a wall-hung vanity, too. Note the instructions call for licensed professional installation, but I generally just regard such cautions as a challenge. As do you, or you wouldn't be reading this!
Step 2: Mark the Wall and Cut a Hole
You need to cut a horizontal hole exactly the same size as your piece of wood at the height of the clips on the back of the vanity (you will need to figure that height out yourself - it will depend on the exact model of your vanity and how high you want the top of your vanity to be). You can do the cutting with an Exacto knife if you're patient, or an oscillating tool if you're not. I'm not. I own an inexpensive oscillating tool and it makes any manner of demolition tasks way easier. Wish I'd bought one years ago. It took about two minutes to cut the hole.
Step 3: Mark the Studs (and Anything Else!) on the Wood
You're going to fill the hole you just created with the piece of wood you cut to length, but first you need to cut notches out to accommodate the studs and any plumbing/wires that might be behind the vanity. You want to cut the notches deep enough so the wood remaining is exactly the same thickness as the drywall. I did it with multiple passes on a table saw but a circular saw or handsaw and chisel would all work fine too. I made cutouts for 4 studs and a 4" vent. None of the studs were in the right place for the vanity, but annoyingly the vent was in exactly the *wrong* place. This meant I had to use shorter screws for that bracket (no deeper than the thickness of the drywall), but better than no bracket at all, which is what I'd have to have done with the recommended method (because the drywall would still be there).
Don't forget to mark the position of the studs (for where to screw) and anything else e.g. pipes, wires, etc (for where not to!).
Step 4: Fix Wood in Place, Paint
Push the wood into the hole and screw it in place. Do NOT rely just on screws through the narrow part of the wood into the studs - also add angled ones either side. Paint the wood and drywall. Yes, this is still going to look a little rough, but it's the back of your vanity! Chill out, no one will see it. It's dark in there and full of stuff. Or it soon will be.
Step 5: Mount Brackets and Vanity
Screw the brackets supplied with your vanity to your nice strong support and pop the vanity into place. I say "pop in place" like it was straightforward, but the carcass was heavy and required me lifting it solo with my forehead pressed against the wall for balance. Not the easiest job ever, and I did it three times because I needed to mark the back for relief cuts for the water supply lines, because the previous installer hadn't bothered actually putting the plumbing in the middle of the wall like a rational person. Grr.
Final thoughts: I figured if I wrote this up I might save a reader or two some time and hassle, and stop them unnecessarily hacking big holes in their wall. This approach gives a rock-solid result and was quick and easy compared to what was recommended.