As Beth said, it probably is going to be helpful to exercise the dog first, but after that, I don't think it's going to help much with an infected ear. Most dogs won't be distracted when you're going to do something to them that will probably hurt, since they're infected. Shaving the ears is also a good thing, but again, buzzing and irritation are probably going to have your dog struggling too much while the ears are bad. It's a good idea once they're healed, though.
I've also seen every other poster talk about the cotton ball method. I know that one poster said the vet showed it to them. While it may be better than nothing, I don't recommend it. The reason I don't think it works well is because a dogs ear canal isn't straight. It's "L" shaped. So even if you push a cotton ball all the way to the bottom, as far as you can reach, then fill the ear canal with solution, then you're only cleaning half the ear. The proper way to clean the ear is to fill it with solution, and massage the ear. It's best done by grabbing the base of the ear and working it around. This will also be less painful than sticking your finger inside and rubbing it around. You should do this for a couple of minutes. Then let your dog shake their head. The solution and agitation of the ear should have broken up some of the wax and/or debris and when the dog shakes it's head, the nasty stuff will fly out. Feel free to have a towel to hold by the dogs head to keep this from flying all over the place.
As far as controlling the dog, you'll have to figure out what works for you and your dog. You will probably have to put them into some kind of wrestlers lock till they become more used to it. I've had some dogs that would rather lay down to have it done. I could put a leg over their body to hold it in place, use the hand closest to the nose to hold the head down and the ear open, and use my free hand to apply the medicine. Dogs of all sizes can be squeezed between your legs gently to restrain them. With small dogs, you can sit on the couch and put them between your legs, closing them gently to keep them in place. I'll put the pinky, ring, and middle fingers of my securing hand around their head to keep them from turning away and the other hand to squirt solution in the ear. You can do the same process with a large dog, but have them on the floor while you sit on the couch.
You dog will probably try to wrestle away from you. You just need to use your body to block theirs. If they keep trying to scoot backwards, then use the couch or a wall to block them. If they try to turn their head away, then use your off hand to hold it steady. It's just a dexterity and thinking your way through it thing. I once saw my aunt, mother, brother, and cousin trying to put eye drops in a 5lb Pomeranian. When all four couldn't do it, they asked me for help. I put him between my legs, used three fingers to hold his head, two to pull his eyelids apart and the free hand to apply the medicine. I got both eyes done by myself in about 60 seconds. So it can be done, it's just experience. Don't be afraid to put him in a gentle body lock, but if you feel even an iota of doubt about whether he'll snap when you hold him that constrictively and do something uncomfortable, then buy a muzzle for him.
To make it a little more comfortable for the dog, I like to put the ear cleaning solution under my side till it comes up to body temp. It has to be more pleasant than when it's cold, which it tends to be winter or summer out of the drawer in the house.
Lastly, once the dog shakes his head to clear out the solution, use your cotton ball or paper towels to clean the excess gunk out of the part of the ear you can reach. Everyone will recommend you not to do the following, but if you're very careful, have a good hold on your dog, and are ready to pull a way if the move, you can use a cotton swab to get in the creases of the ear. I use these especially when the ear is really nasty. The cotton ball and paper towels can't get into all the crannies. I've seen my vet do it plenty of times. They just don't recommend people do it at home to avoid potential injury to the dog. Sometimes they feel so good, they'll lean into it. Then once the ear is wiped out, let it sit for a little while to air out and then go back and apply the medication.
Also, I can't remember which poster mentioned it, but if you have a lot of trouble with it, they have a medicated gunk they can put it. It's like axel grease and the dog can't hear for a long while, but it works with no fuss. They put it in at the vet.