In such fanfics, sometimes a hidden power within the person needing help emerges, allowing them to overcome the situation on their own. Or, a previously unknown ally steps forward with crucial information or a magical item.
Often, a fellow wizard or magical creature comes to the rescue, using spells or their unique abilities.
Well, it could go a few ways. Maybe a teacher at Hogwarts intervenes and offers guidance. Or perhaps a friend of the person discovers their predicament and rallies others to assist.