You are referencing Acts 18:21. Not all versions have verse 21 as you cite it, but I won't get into that. For your answer, go up a little to verse 18.
Paul, Priscilla, and Aquila are sailing to Syria. It says that Paul has
cut his hair because he made a vow. That's important to answer your question.
What kind of vow require the cutting off of one's hair? The Nazarite vow. [See
Numbers 6 - the whole chapter]. Apparently Paul had made one.
If one made a vow to God and fully intended to keep it, one had to NOT cut one's hair for the whole duration of the vow. Such as a man might have said, "For the next 10 years, I will give a tenth of my crop to those with no food." Or a woman might have said, "Until my child grows up and leaves the house, whenever I have to sew him a new garment, I will sew two - one extra for those who can't."
When the vow was over, one was to cut the hair, bring it to the tabernacle/Temple and burn it along with several sacrifices.
Paul said he had to go to Jerusalem. Well, if he made that Nazarite vow, he did. He had to burn his hair at that one and only place. In saying, "I have to attend the feast....", I think he means I have to get to Jerusalem. The feast wasn't the issue. Verse 18 is the issue.