Easiest is to use what we use .. that is a
'crate'. It is essentially a wire cage with a door (obviously) and large enough the dog can stand up.
It is used extensively in the USA and is invaluable. The dog is secure and safe. You are free to do whatever your heart (or loins) desires.