Dogs, unlike us, their owners, perceive vacuum cleaners not as helpers for cleaning the house, but as large and scary predators.
If you are tired of the loud barking that is heard in your apartment every time you start cleaning, try the following methods - they will make friends with your pet and household appliances.
It's worth starting with accustoming the dog to the very fact of the vacuum cleaner's existence.

Take the dust collector out of the closet or wherever you keep it and wait for your dog to get brave enough to approach it, then reward him.
Do this "trick" for a week, and then start training your dog by telling him to stay put and slowly moving the vacuum cleaner towards him.
If successful, reward the animal.
Your goal is to ensure that your pet becomes indifferent to the device.
If your dog is afraid not of the sight, but of the noise that the equipment makes when cleaning, you will have to find this sound on the Internet.
Turn it on periodically while spending time with your pet.
Try watching cleaning videos with your dog every day, and give him a reward every time.
Of course, you shouldn't wait for your dog to get used to the vacuum cleaner while in an untidy apartment.
Therefore, during the training process, clean the house when another family member is walking the dog or taking him to visit.