Three parts
Technical SEO (speed, sound structure, sitemap, redirects), content (pages that answer what people search for) and authority (mentions and links from other sites).
SEO and AI
More and more searches are answered by AI tools. A clean structure, proper structured data and substantial content help a site appear there too.
The most common mistake
Launching a new site without 301 redirects from the old URLs. Rankings built over years are lost.