As part of teaching basic commands, you can start slowly by putting your dog on a long (or retractable) leash. This is a great way to slowly introduce your dog to the idea of wandering more freely. As it becomes accustomed to the longer lead, make sure you use the basic commands, and assess how well it responds.
However, be aware that a long leash poses some risks. Be careful if you’re in public areas with a lot of people as you have less control should your dog suddenly decide to run after something. Long leashes can also get tangled in things, or worse, they can “clothesline” other people and knock them over. If you’re new to using a long leash, start somewhere with less people and with ample space around you.