Regeneration works as a replacement effect: instead of being destroyed, a creature with a regeneration shield is tapped, removed from combat, and has all damage marked on it removed (CR 701.15b). This replacement applies at the moment the game would destroy the creature, not when damage is assigned.
In the combat damage step, damage is first assigned (509.2) and then dealt simultaneously (510.1). After damage is assigned but before it is dealt, players receive priority and may activate regeneration abilities (CR 509.4). This is the ideal window — you can see exactly how much damage is coming and respond accordingly.
Even if you miss that window, regeneration still works: when state-based actions are checked and the game sees a creature with lethal damage, the regeneration shield replaces the destruction event (CR 704.5g, 614.1a). So the creature survives as long as a shield was in place before state-based actions resolved.
Concrete example: Your 2/2 creature blocks a 3/3 attacker. After the 3 damage is assigned but before it is dealt, you activate a regeneration ability, creating a shield. When the 3 damage is dealt and state-based actions check, instead of being destroyed, your creature is tapped, removed from combat, and its damage is cleared — it survives.
Note: Regeneration does not prevent damage from sources with deathtouch or the exile clause on some destroy effects (e.g., "destroy and it can't be regenerated"). Those override the shield entirely (CR 701.15b, 702.2c).
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.