If you designate a specific spot in your yard for your dog to do its business you won’t have a yard full of yellow spots or accidentally step in something undesirable.
Start off with having your dog on leash and take them to the area you want them to go. Ask them to “go pee pee” or “go poo poo” and wait until they do.
Give them some slack on the leash so they can sniff around.
Be sure to praise your dog verbally by saying something like “Good pee pees Rover” and give them a pat to the side of their body while verbalizing the good work. You will need to be consistent with where you want your dog to do its business; so yes, at the beginning you will have to be out there with them until they understand their designated area.