To do this I first determine the location of the waypoint and then enable the proximity alarm and set its radius; your chartplotter manual will tell you how to do this. If your boat crosses the boundary the alarm will go off. For example, if I establish a waypoint 660 feet downwind and set the proximity alarm at 605 feet, I am creating a boundary just 50 feet behind the boat. If the anchor drags and the boat crosses the line, the alarm will go off. This gives me absolute control over the situation and, more importantly, I always know exactly where I am. To set multiple safety perimeters and box in the boat, all I have to do is establish more waypoints.
If the chartplotter's alarm is not loud enough to wake you, you can connect the chartplotter signal to a loud buzzer, siren, or alarm bell.
Obviously, this method relies on electronic equipment to guard your flank. If there is strong wind or other unusual circumstances, you should always think about setting a formal anchor watch.
But even when someone is standing an anchor watch, the plotter's safety perimeter and tracking display can still be very helpful because it can confirm that your anchor is holding and it will let you know promptly if you start to drag.
Computer-based navigation software with a boundary-zone function is often even easier to use when you want to establish a safety perimeter. All you have to do is draw the boundary with your mouse and then establish the alarm conditions. But the PC's alarm may not be loud enough to wake you, so this is another case where you should consider connecting the computer alarm to external speakers.