Aposematism is when an animal distinguishes itself, perhaps by bright colors or stripes or some noticeable visual cue, as a warning that it’s dangerous. Predators learn to avoid the dangers of the animal by recognizing it. Brightly colored coral snake – very dangerous, and very recognizeable.
So another animal evolves to take advantage of the coral snake’s badass reputation – I don’t remember the particular snake, but there’s a relatively harmless snake that LOOKS like the coral snake, and presumably is safer because it gets constantly mistaken for its dangerous cousin.
My recollection is that this is called aposematic mimicry.
Now, there must be an opposite side to this, where a predator pretends to be something harmless, helpless, and good-tasting to lure in a would-be attacker, only to turn the tables and gobble up the would-be gobbler.
The kind of mimicry you describe in the OP, in which a harmless species resembles a dangerous one, is specifically called Batesian mimicry. Another common type, in which various dangerous species resemble one another, is known as Mullerian mimicry.
Off the top of my head, I recall fish (Anglerfish) and even some turtles that exhibit these adaptions - they have “dangly bitz” that look edible to passing fish, and when the would-be-eater gets too close, they strike quickly and gulp them down.