You should interview often
I hate interviews, but I have recently realized that interviewing is a part of a successful career. When you work for the same employer for a long time you can easily lose connection with your field outside of that employer’s work. When you interview you have to ramp up again on things you may have missed. You gain the skill of representing your work objectively. You learn to give a good summary of each of your projects and represent their successes and failures. You learn to tell your story more efficiently. Think of it as a continuous learning effort.
How often should you interview? You should try to land at least one new offer every year. You don’t need to accept it, but you may get a good pay bump and a better position out of one of these offers. When you turn down an offer from a company, you will be on their radar. You can easily reach out again to get a job if you need one.