The first step is to choose the command you want to use. "Stay" is a common choice, but you can use whatever command you like.
When you're first starting out, it's best to start in a quiet place where there are no distractions.
Before you give the command, get your dog's attention. You can do this by clapping your hands, making a noise, or calling their name.
Once you have your dog's attention, say the command and take a step back.
If your dog stays in place, mark the behavior with a word like "yes" or a click of a clicker. Then, immediately give them a treat or praise.
As your dog gets better at staying in place, gradually increase the distance between you and them.
Once your dog is consistently staying in place when there are no distractions, start adding distractions.