Look for an in-house role at a company with an seo team (ie not a solo in-house role). Pay is way better, the work is more directional and you don’t have an agency director trying to squeeze every billable hour out of your soul with the ever-present threat of redundancy if a client walks. 5+ years experience should be enough to get into a decent company, may as well see if they prefer it before throwing the experience and knowledge they’ve built up away.
But if that doesn’t work out, they can absolutely look at pivoting. I worked in graphic design and print production for 8 years before restarting my career from scratch in an entry level SEO role. It was out of necessity as the company I worked for went out of business and I really didn’t want to go back to working in print, but it’s paid off in the long run with a solid career and income.
The thing to do is for your friend to sit down and make a list of all the hard and soft skills they’ve developed so far and then convert them into ‘generic’ skills (ie rewrite them without a specific reference to SEO). This’ll help them understand what transferable skills they have which could apply to other jobs outside of SEO, then they can go looking for job descriptions which ask for those skills as a starting point to get an idea of what jobs they might be able to transfer into.
From there they can make a short list of jobs that they like the sound of or think they might enjoy, and look at what other skills, qualifications or experience those roles also ask for. Some of the jobs they may already be qualified for, whilst others they might need to take some extra training or courses etc, or seek a more junior version of the job to get the experience. But at least that gives them a roadmap to follow and goals to work towards. They may even be able to build some of those skills by volunteering to help people in other departments in his current agency, which could also give them a taster of adjacent disciplines to decide if they like them or not.