'Now the Passover and Unleavened Bread were two days away; and the chief priests and the scribes were seeking how to seize Him by stealth and kill Him; for they were saying, "Not during the festival, otherwise there might be a riot of the people." While He was in Bethany at the home of Simon the leper, and reclining at the table, there came a woman with an alabaster vial of very costly perfume of pure nard; and she broke the vial and poured it over His head. But some were indignantly remarking to one another, "Why has this perfume been wasted? For this perfume might have been sold for over three hundred denarii, and the money given to the poor." And they were scolding her. But Jesus said, "Let her alone; why do you bother her? She has done a good deed to Me. For you always have the poor with you, and whenever you wish you can do good to them; but you do not always have Me. She has done what she could; she has anointed My body beforehand for the burial. Truly I say to you, wherever the gospel is preached in the whole world, what this woman has done will also be spoken of in memory of her." '
Mark 14:1-9 (https://www.bible.com/bible/100/MRK.14.1-9)
This woman places Christ above everything else. She came to worship Him. Doing good deeds has its time and place, but nothing is more important than worshipping our Savior. The rule is not to do good works, the rule is to put God before everything. doing good deeds does not save you, it is something you want to do because you are saved. Repenting and putting God first in your life is what saves you.