Consent petting is the practice of reading your dog's body language to determine if, when, and how they want to receive physical affection. When we give an animal the ability to choose something, rather than use force, we are showing the animal that we listen to them and will respect their needs. As a general rule, if you touch your dog in a certain way and they move away from you, it’s safe to assume they didn’t want to be touched like that at that moment. However, just because your dog moves away once doesn’t mean they never want to be touched that way. If your dog reliably moves away from you when you touch them in a certain way, you can assume that sort of touch is unwelcome, but if it only happens at certain times it’s possible they don’t like any touch under those circumstances.
When your dog places themself within an arm's distance from you, use your hand to scratch their neck, under their chin or behind their ears. It's always better to go under, than over! Reaching over your dog's head can be uncomfortable for them. Scratch them 2-3 times, and then stop and move your hand back onto your lap. If they stay where they are or move away from your hand, don't pet again. If they lean in, nudge you, or paw towards your hand, repeat the above steps for another few scratches. In general, if a dog is moving away from you, that's a good indication to stop, and if a dog is moving towards you, that's a good indication to keep going.