Stay is a fairly easy trick for most adult dogs. Puppies will have difficuty with this trick- but it's great for developing concentration and self-control.
This method of teaching a dog to stay- although it starts out very, very structured- is how you eventually teach your dog to stay in any position or even in awkward places.
Stay should, at first, be taught from the heel position on a leash. Walk with the dog at your left side, stop and have the dog sit. Extend your left hand down and place it directly in front of the dogs nose- touching or just an inch from the nose. Say "stay" very firmly. Step out in front of the dog- just 6 or 12 inches from the dogs nose and wait just 30 seconds or less. If the dog does not move, return back to the dogs side, treat, and praise "good stay, good stay". If he does move (remember, you are standing very close, so he shouldn't be able to move other than just standing) push him back into a sit and say "stay", wait a few seconds, then return to the side and praise.
In the early stages of teaching your dog to stay, the idea is to move and treat before the dog thinks about moving. As he catches on, extend your hand in front of his face to signal stay, step in front of him close, and wait longer and longer periods. It may help to hold the treat in your hand and let the dog watch and concentrate on the treat.
When your dog can handle two or three minutes without moving, it's time to start taking one or two steps back when you signal him to stay. If the dog stands and tries to move, simply place him back into position.
You can train sit-stay and down-stay simultaneously, but when you can do a sit stay for three or more minutes standing at the end of a six-foot leash, then you are ready to work on the notoriously difficult "stand stay". (Typically taught to show dogs, but very useful at the vets or groomers)
Once your dog can stand in these positions, stay is a great trick to start applying in the house and for fun. I love taking silly pictures of my dog and teaching a reliable stay has enabled me to "place" her in a complicated position with a certain head tilt or paw lifted, tell her to "stay" and have her hold that position until I release her.
Training a dog to stay is not easy for most dogs. Keep in mind that energetic dogs will need to learn this trick slowly.