Shaving your dog is not going to get rid of fleas. While removing your dog's fur will make it easier to spot fleas and flea dirt, it will not remove fleas. Fleas spend most of their time on your dog's skin rather than hiding in the fur itself, and shaving won't remove flea eggs, larvae, or pupae from your home or garden.
Your dog's fur also provides important protection from sunburn, insect bites, overheating, and skin irritation. Shaving can leave your dog's skin more exposed and, in some breeds, the coat may not grow back properly. Unless your vet advises it for a medical reason, it's better to keep your dog's fur well-groomed rather than shaved. A flea comb can help with this. Regular brushing with a flea comb helps to remove fleas and flea dirt.
The most effective way to get rid of fleas is to use a vet-strength flea treatment, like Itch Flea Treatment for Dogs that kills adult fleas and disrupts the flea life cycle. Washing your dog's bedding and vacuuming carpets, furniture, and floors regularly will help reduce fleas in the house. Treating all pets in the household at the same time is also essential to prevent reinfestation, this way fleas have no host to feed on.