Here's how it worked:
* The cure was a bit paradoxical: The basilisk venom, the same substance that petrified people, also contained the antidote.
* The cure was administered through Fawkes, Dumbledore's phoenix: Fawkes' tears had the ability to heal wounds, including petrification. Fawkes cried tears of basilisk venom, which, when applied to the petrified victims, reversed the process.
It's a bit of a twist, but it highlights the complexities of the magical world and the power of the basilisk.