To compensate for his lifelong ignorance of his people's suffering, the "Happy Prince" did what he still could to recognize and lessen their misery. He started by asking the Swallow to take the ruby from his sword-hilt to a seamstress who needed oranges for her sick son. He then gave up each of his sapphire eyes to help two people obtain relief from the cold.
After sacrificing his eyesight, the Prince did not let himself become blind to poverty and pain again. Instead he asked the Swallow to fly all over the city, come back, and tell him about the suffering he had seen.
When the Swallow returned from his trip, he told the Prince about beggars sitting outside rich people's gates and cold, starving children in dark lanes. In response, the Prince instructed him to pick all the gold off his statue and take it to the poor so they could eat and be happy for a while.
The Happy Prince made up for his former blindness to want and sorrow by giving up his splendor, and even his sight, to brighten the lives of the poorest people in his city.