When the suspect has the high ground, and you are in a car, drive rapidly through it. You will be a more difficult target. Some officers might immediately stop, reverse, or U-turn. That might slow you or stop you, which gives the suspect a chance to hit you.
In Restaurants
I like my back to a wall, so no one can walk behind me, but that is not always possible. Plus, a lot of people know that's "the cop seat," and they can spot you. If you are off-duty or working plainclothes, consider avoiding it. Whether in uniform or plainclothes, use a table, not a booth, so you can move more quickly out of it. Stay away from window seats. When sitting with multiple officers, communicate your respective area of responsibility such as front door, rear door, etc. Watch people when they enter. Look for squirrely behavior, the thousand-yard stare, the target stare, bulges in clothing, manner of clothing (does it fit the weather?), and unusual gait.
Watch how other cops act in these situations to learn what not to do. Many remain oblivious to the world around them. They are entranced by their phone or by their computer. I recently walked into a coffee shop and saw two law enforcement officers sitting right by the front door, buried in their laptops. Neither even gave me—an armed man—a second look when I entered the front door.
In the Station