Well... dogs actually have an erection pretty much easy (well, aren't we males that way (?) lol), but jokes apart, usually when a dog gets an erection is usually pretty much closer to what we usually call "their climax", and once it gets like that, you have two choices:
1- To leave him as it is and it'll slowly come back to the sheath
2-Keep him by the knot's base (please pull it out gently before it swells up so he feels more comfortable) and keep him at least for a while until he shrinks.
The more "proper way" i think it is to get a dog to have an orgasm/erection is usually to grab the sheath gentle like how you'd hold a hot dog in your hand (jokes apart), i mean, you're using the own dog's sheath as their penises are extremely sensitive and usually our hands are "too dry" for them and makes them a bit uncomfortable (plus our body temps are lower, so, imagine placing a bottle of coke at your inner thigh, like that , lol). Once you hold him that way, you use his own sheath to gently stroke up and down, but try to focus on the part where his knot swells up, and a bit more closer to his body, that's their most sensitive place and where they get usually more excited and stimulated. The dog usually will hump, you wanna get him to do this if you want a posible mounting in the future, and once you notice his member starts to grow, try to gently pull the sheath out and then use your thumb and inder finger like a "ring" around the knot's base and make soft and gentle prods by "clenching" your fingers against that part (usually a more thin trunk in comparison to the knot which will be considerable larger and thicker).
Just try it once you can, and remember the dog may be erect for at least 2-5 minutes after you release him if he orgasmed, and if he didn't the penis will usually come back quickly, but the dog will be horny and worked up and you'll see him more eager to continue