Cardinals wear red, because it’s the apostolic color – the color of martyr’s blood.
The pope used to wear red, but started wearing white when one of the popes (Pope Pius V) kept wearing the white robes of his religious order (he was a Dominican) after becoming pope. You’ll notice that when the current pope wears choir dress or that nice fur-trimmed top layer for warmth, they are still red; the same with the pope’s shoes. Sometimes he wears a red hat, too.
Bishops wear “amaranth red”, which is basically purple. (It’s a very reddish purple, I agree; but Roman purple was very red; what we call purple was called violet in the Roman Empire.) Nobody seems sure why, except that it’s a convenient color code.
Priests wear black because it used to be considered a sober, serious color for serious and prudent people, several centuries back, once black dyes became colorfast. Business dress used to be black, for instance. It has a lot of advantages (doesn’t show stains, goes with everything).
The beanies are called zucchettos. They keep your head warm in a cold church, and are easier hats to deal with than a beretta, a saturno, or a galero. Priests and deacons can wear zucchettos (in black), but usually don’t, these days; they usually wear berettas or nothing in church.