When a creature is declared as a blocker during the Declare Blockers Step, the attacking creature's status becomes 'blocked.' This status does not change even if the blocking creature is later removed from combat or leaves the battlefield entirely (CR 509.1h).
Damage assignment then occurs in the Combat Damage Step. A blocked creature with no remaining blockers simply deals its damage to nothing — it does not 'punch through' to the defending player (CR 510.1c). The only exception is if the attacking creature has trample, in which case it may assign excess damage to the defending player (CR 702.19b).
So removing a blocker with a spell like Lightning Bolt after blockers are declared will save your creature, but it will NOT cause the attacker to deal damage to you or your planeswalker.
Concrete example: Your opponent attacks with a 3/3. You block with a 1/3. Your opponent then casts Lightning Bolt targeting your 1/3, killing it before combat damage. The 3/3 is still 'blocked' and deals its 3 damage to nothing — you take 0 damage. If that 3/3 had trample, it would deal 3 damage to you instead.
The key rules at play are CR 509.1h (blocked status persists) and CR 510.1c (blocked creatures with no remaining blocker deal damage to no one), plus CR 702.19b for trample's exception.
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.