What happens next is also unclear. The easiest thing to do is to assume targettingtargeting part of a swarm is the same as targettingtargeting the whole swarm with an attack spell. The swarm makes a save, and on failure takes radiant damage. This, however, is never made explicitly clear in the rules of 5e.
It does not, in general, make sense to treat a swarm as a creature in all contexts. Treating targettingtargeting a part of the swarm as being able to damage the entire swarm results in a reasonable combat simulation 99 times out of 100; you just assume attacks "cleave" through one component of the swarm into others.
The only definition of creatureFrom sage advice:
Can conjure animals summon a swarm? No. Conjure animals summons individual creatures, and swarms are groups of creatures.
In addition, we have in 5e is from this tweet:
Swarm is not there. Beasts are. So a Swarm is indeed a collection of Tiny Beasts. A swarm Swarm is explicitly stated as not a creature, it is a monster composed of creatures in Sage advice.
A DM could reasonably rule that treating a swarm as a creature is correct via rule 0, but RAW swarms are composed of creatures.A swarm is not a creature, it is a monster composed of creatures.
The effects of a creature within a swarm being targettedtargeted are not clear by the rules. So the effect could be marginal and/or determined by the DM. Or you could treat targettingtargeting a creature as part of a swarm similar to targettingtargeting part of a creature's body.
You could make a ruling that targettingtargeting a creature that is part of a swarm simply involves engaging with the entire swarm's game statistics.
The same kind of call has to be made for every spell or effect that targets a creature; is it reasonable that when targettingtargeting an individual creature in a swarm that the effect "blows through" to the rest of the swarm or not.
Similarly, ruling should be made when area effect damage is applied to a swarm. A large-volume fireball hitting a swarm of ravens that deals more than 20 damage per creature would reasonably instant-kill the entire swarm, even though the swarm has more than 20 HP left, as the fireball by the rules deals 20 damage to each creature (beast) in the swarm.
Each creature in a 20-foot radius Sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one.
A Swarm is a collection of creatures, and Fireball targets each and every creature within its radius. By RAW, each creature in that swarm has to make a Dexterity saving throw, and take either full or half damage.