Anchoring looks easy right up until the wind fills in and you're sliding toward the rocks at 2am. Get it right and the boat sits there all night. Get it wrong and you're up every hour with the engine running. The good news is it's mostly technique.
Pick your spot
You want shelter from the wind and swell, a bottom that actually holds (sand or mud, not rock or weed), enough depth, and room to swing without clobbering another boat or fetching up on a shoal when the wind clocks around. Check the tide both ways: enough water under you at low, and enough scope out for the extra depth at high.
How much rode
Scope is how much rode (chain or line) you put out compared to the depth, measured from the bow. Seven to one is the classic starting point: seven feet of rode for every foot of water. More scope lays the pull flatter and holds better. In a dead calm you might get away with five to one. When it's blowing, err long.
Set it
Motor up into the wind or current, stop, and lower the anchor to the bottom. Don't heave it over the side; you'll just pile the chain on top of it. As the boat falls back, feed out rode until you've got your scope, then snub it off. Give it a moment to settle, then back down in reverse to dig the flukes in.
Make sure it's holding
With the engine still pushing gently astern, line up two fixed things on shore, one behind the other. If they stay lined up and the boat stops moving back, you're set. If they slide apart or the anchor keeps skipping, you're dragging. Pull it up and do it again. Nobody sets it perfectly every time.
Keep a watch
A good set can still let go when the wind shifts or builds overnight. Fix your position and set an anchor alarm to wake you if you swing outside a set radius. Pathr's Anchor Watch handles that part: drop anchor, set the radius, and it sounds off if you start to drift.
Getting it back
To leave, motor slowly up toward the anchor while you take in the slack, then break it out once the rode is straight up and down. Hose the mud off before it comes over the rail.