Choose routes that have less traffic, and/or choose a better time to ride.
I'll often take longer less traveled routes, just to avoid hostile motorists.
Motorists often take the most congested routes, because GPS told them to, one block over, its crickets.
You can't fix careless motorists, so its best to avoid them if possible.