'There is a whole field of UX optimization that requires its own level of expertise. The typical SEO professional doesn’t have to be a full-fledged UX expert. However, they should have an understanding of many of the basic website UX principles. UX optimization is nothing more than focusing on the visitor.
Everything we do in the sphere of web marketing has to have the visitor in mind. Yes, we do certain things for search engines, but search engines (almost always) require those things because they have learned it’s what their users (searchers) want.
https://www.searchenginejournal.com/seo-guide/where-seo-and-user-experience-ux-collide/