Protection from a quality prevents four things, commonly remembered by the acronym DEBT: the protected creature cannot be Damaged, Enchanted/Equipped/Fortified, Blocked, or Targeted by anything that has the quality it is protected from (CR 702.16b).
The 'D' in DEBT is key here: all damage that would be dealt to a creature with protection by a source of the relevant quality is prevented (CR 702.16b, 702.16d). This happens before damage is actually dealt, so you cannot even legally assign combat damage to it from such a source.
Furthermore, the 'B' means the protected creature cannot legally block (or be blocked by, depending on which side has protection) an attacker of the protected color in the first place. If an illegal block somehow occurred, the damage prevention would still apply (CR 509.1b).
Concrete example: Your opponent attacks with a Goblin Guide (a red creature). You block with a creature that has protection from red. The block is illegal and should not have been declared — but even if it were somehow in place, all combat damage from Goblin Guide to that creature would be prevented, so the blocking creature takes 0 damage.
In short, protection provides a complete shield: the protected creature cannot be assigned or dealt combat damage by sources that match the protected quality (CR 702.16b).
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.