In the Mail app go to the preferences (Settings in macOS Ventura) and click on Junk Mail. If it is enabled then on the bottom of that window, you should see a button titled Reset... Click that and confirm that you want to reset the rules on the popup window.