Well, to put it simply, it's a combination of inserting some codes on your website plus some content marketing for your content.
Let me explain more; let's say you have an online store and want to rank for the keyword "blue shirt" (BTW, a keyword is what a person enters into search engines to look something up). What's the first thing to do? First, you must create content; that means you must have something on your website that is related to "blue shirt." Things like where the blue shirt came from, what it is made of, what a blue shirt represents, and maybe even the whole history of "blue shirt." But try not to overdo it. You must have some answers; imagine searching for something on Google and clicking on the first link to find out that it has nothing to do with what you searched. You will get angry, right? So does the search engine. After you have created your content, you must send some signals to the search engines and let them know what your content is regarding. These signals include title, description, and headings used on your website. Don't forget to speed up your website because we all hate slow websites, and so does the search engine.