There are various Holi legends. The most famous one is about Prahlada who was ardent devotee of Lord Vishnu.
Prahlada, the son of demon Hiranyakashipu and his wife Kayadhu, was born and brought up under guidance of sage Narada when Hiranyakashipu was busy in pleasing Lord Brahma to gain immortality.
Hiranyakashipu, the father of Prahlada, was enemy of Lord Vishnu. He was highly against of his son being devotee of Lord Vishnu. When Prahlada refused to obey Hiranyakashipu, Hiranyakashipu asked his sister Holika, a lady demon, to kill Prahlada. Holika had divine shawl, gifted by Lord Brahma, to protect her from fire. Holika made a plan to kill Prahlada in a huge bonfire. Holika lured Prahlada in bonfire but due to grace of Lord Vishnu, divine shawl protected Prahlada instead of Holika.
As folklore goes when the fire was lit Prahlada started chanting the name of Lord Vishnu. When Lord Vishnu found his devotee in danger he summoned a gust of wind to blow the shawl off to Holika and on to his devotee Prahlada. Hence demoness Holika was burned to ashes in huge bonfire and Prahlada was unhurt due to grace of Lord Vishnu and divine shawl.
Later, when Hiranyakashipu didn’t stop his attempts to kill Prahlada, Lord Vishnu appeared on the Earth in form of Lord Narasimha to protect Prahlada and to kill demon Hiranyakashipu.