I have to clean Lenny's ears twice per week and this is what works for me. Firstly they're going to shake their head a some point so stay in front of the dog so the spray goes sideways and doesn't hit you (mostly). If you're working on the left ear, hold the ear flap up with the right hand and hold the bottle in the right hand as well. Use left hand to help to clear the way to the ear passage. Squirt some ear cleaner into the ear and immediately work it down into the ear with left hand and start massaging at the base of the ear to work it into the wax. Lenny seems to enjoy that bit enough to keep his head still long enough to allow the job to be done. When you've done enough of that, let go and the dog will probably then shake.
Good luck!