Obey the rules specific to the location you are visiting and plan ahead:
Check in with your destination ahead of time
Know the rules and regulations of the land manager
Should you decide that your dog will accompany you on your next hike:
keep him/her on a leash and under your control at all times
When encountering other trail users, dogs and owners must yield the right-of-way, stepping well clear of the trail to allow other users to pass without worrying about proximity
Keep your dog out of water sources, away from wildlife