Full disclosure here: I am a community policing volunteer, and have been for over a decade. I'm on the steering committee of a local council that is supposed to be a conduit between Neighborhood Watch groups in our area and the police. I've worked with a number of cops, who were about as varied as most groups of humans. As for their attitudes toward people of color, I couldn't tell you. The neighborhood I live in is about as white and upper income as Oakland, California gets. But I never heard of any of the cops we worked with shooting anyone; and believe me, in this area when a cop shoots someone, it makes the news.
But why do cops need to be armed? British cops aren't, among quite a list of others. I say American cops need to be armed because Americans, as a group, are armed. In a 2017 survey cited in Wikipedia, there were 120.5 firearms for every 100 citizens in the U.S., the vast majority of them not registered. And Money magazine says that, during 2020, nearly 40 million guns were bought legally (note the caveat!), and another 4.1 million just in January 2021. There are literally more guns than people in this country.
This has nothing to do with how cops are trained to handle situations, or their general attitude toward people of color, which is a whole different issue. But an unarmed policeman in America would be an absolute sitting duck. He assumes the people he's looking at are armed because, in fact, they may be.
Our problem in the U.S. today is not cops with guns. Our problem is too many guns, generally.