Training your dog to go to his mat or basket is a really useful "trick" since you can basically put him where you want him and tell him to stay there until you say he can move.
It's a bit the reverse of what human babies do. For their first six months they pretty much stay where you put them. Then one day they learn how to crawl and suddenly you've got a problem. You put them down over here, but suddenly they're over THERE - behind the sofa or whatever.
A puppy can run all over the place from the age of a few weeks and what you want to be able to do is to stop him from doing this and get him to go where you want him to be.
Fortunately this is a fairly easy thing to train him to do (By the way, I apologise to those of you who have a bitch, but I use "him" as it's simpler than saying "him/her" every time).
You should have a mat or basket for your dog to sleep in/on. You also need a supply of small treats..
Place the mat on the floor at one side of the room.
Say to the dog "Go to your mat" If he moves nearer the mat throw down a small treat. If he moves away from the mat say "Go to your mat" again. Nearer the mat he gets a treat. Away from the mat he gets no treat and is told what you want him to do.
If he barks or jumps up at you, simply turn your back and ignore him. Just keep an eye out over your shoulder so that if he moves nearer the mat you throw down a treat. If he gets very close to the mat or actually on it you say "Good dog" and give him TWO treats.
Keep repeating this and you should find that fairly quickly your dog works out for himself that when he gets near the mat he gets a reward and when he moves away from it he doesn't. And when he gets ON the mat he gets double treats!
I watched a colleague of mine train an eleven week old retriever to do this and the dog was actually sitting on the mat in about eight minutes!
What you are training your dog to do is to think for himself. \he soon works out that "Oh, yep, if I go over HERE I get a treat, but if I go over THERE I don't get a treat. Think I'll go over HERE more often!".
Forgive the pun, but it works a treat.