It takes a lot of time, work and patience but, eventually, you reach an understanding. Any growling or snapping need a firm NO, followed by walking away and a period of being ignored.
The cats should have an opportunity (if possible) to be near, yet separated from, the dog, preferably higher, too.
We had a baby gate in the hall and a cat flap in an upstairs window (temporarily, for six months) so they could sit on the stairs, observe, get out onto the extension roof and into the garden via their cat ladder.
At night, the cats had the run of the house, the dog was in my room. She always had her harness and lead on to visit the garden. During the day, it gave the cats sufficient warning to get to safety before she was 'released'!
I had treats in my pocket (some of her daily food allowance) to distract her from other dogs when out, and to curb her chasing instinct when the cats were about.
Thousands of long walks, 'What a good girl!' and NO's later, with allowance for the two years they need to mature mentally, we have a very nice little dog who's great friends with cats - all seemed impossible back then.