if it hurts stop doing it. you aren't getting paid millions to sacrfice your knees so don't buy into this 'warrior mentality' that meatheads on social media push. it is your knees and you only been blessed with 2 of them, so take care of them
my rec'd is lay off a while and go super light and see how you do.. also your form could be off.. there is an insane amount of people in the gym who squat who do it with horrible form. i'm talking literally 90%+ of people. to fix form you should try box squats or front squats, it will prevent you from cheating