Start with your dog in either a "sit" or a "down." I find that "down" generally works better because it takes more energy to get up from laying down than sitting. However, you can use whichever one your dog is more comfortable with at first.
If your dog is really new to the idea of staying, reward them just for holding the position without moving while you are still standing right in front of them.
Begin by taking one small step backwards and then immediately come back and reward your dog. The biggest mistake people tend to make when teaching "stay" is that they go too far too fast.
Do this a few times until your dog seems to understand it. Then you can take two steps and come back and reward (and so on).
You can also start to change the amount of time you stay away from your dog before returning to them and rewarding. I recommend not working on "come" and "stay" in the same training session at first because they are opposite behaviors.
Make sure you are only working on adding either distance (another step back) OR duration (staying away from your dog for longer) at one time. Don't take another step back and also try to wait five seconds in the same step. Split it up, and celebrate the small victories.
Continue adding distance and duration over several training sessions. You can also start to try things like walking away with your back turned or going around corners out of sight once your dog is more advanced. Make sure you continue doing these things in baby steps at first though too!