Thorough brushing before a bath removes loose hair and significantly improves the effectiveness of the shampoo in cleaning down to the skin. Plus, it makes bathing much less of a 'hairy' job.
Different coats sometimes require different brushes. Prior to brushing, you may want to consider spraying on a detangling grooming mist, which will condition the hair and make brushing easier.
Be systematic about brushing. Start at the head and work toward the tail. Use firm, but gentle strokes with an emphasis on gentle. Pulling or ripping through tangles and mats hurts your pet and quickly erodes trust. Brushing can and should be a pleasurable experience, so take your time.
For pets with thick coats, first brush in the opposite direction of natural hair growth starting at the skin and brushing outward. When the entire coat is brushed this way, start over and brush with the grain. For all other coats, brush in the direction of natural hair growth. Use long strokes for longhaired pets, and short strokes for pets with short or wiry hair.
After brushing, you can use a comb to remove more of the loose hair. A hand-held vacuum also does a good job if your pet will tolerate the noise.