Here’s a great YouTube video on how to get your dog used to wearing a muzzle. Dogs hate muzzles when they first go on, so it’s essential to train them to wear them comfortably if you need one. Muzzles do not keep a dog from wanting to bite, they just keep them from being able to. I only use muzzles to introduce a dog to a person or another dog when I’m sure it should go well, but I still want the situation to be safe, in case I’m wrong. I also use them when dogs who may bite have to be handled, as at the vet. We can’t count on our own timing, because dogs are ridiculously fast!!
If your dog may bite someone and you’re not sure what training to do, learn more about BAT. Behavior Adjustment Training can make your muzzle obsolete.
Definitely follow his sage advice to put the muzzle on at times that are pleasant to the dog, or you will end up undoing all of your work to get the dog to like the muzzle. Dogs are great at making assocations.