There are many different ways in which you can optimize your site for search engines, but I will only be discussing on-page optimization here. On-page optimization includes things like title tags, meta description tags, keywords, image alt text, header tags, CSS, JavaScript, etc. This article is not going to go into depth about all these things but it will give an overview of what they do so that when we get to more advanced topics, you have some knowledge already.
Title Tags - The title tag is one of the most important factors in determining how well a site ranks in Google results. Since the first websites were created, the title has been used as a way to describe the content of the page. If you want people to click through to your site then make sure that the words in your title match those found in the URL (i.e., if your URL says "The Best Dog Food", don't use the word "dog" in your title). Make sure that the words in your title also appear in your heading tags (H1) because this helps with keyword density. Also, keep the length of your title under 100 characters.
Meta Descriptions – Meta descriptions work just like titles except that instead of describing the content of the page, they describe the content of each individual result returned by the search engine. There are no hard rules as far as the wording goes; however, there should always be at least 50 characters since shorter ones tend to be ignored. Keep your descriptions short and concise. Don't overuse them either though since this can actually hurt your ranking.
Keyword Density - You need to include relevant key phrases in your copy, especially in your title tag and your meta description. Search engines look at the number of times your keyword appears within a document's body and determine its importance. So if you're trying to rank #2 for the phrase "best dog food," it would help if you could find a place where that phrase appeared 20 times. However, if you use the same keyword everywhere, it won't matter whether you've got 10 places or 500 places using it. It might still show up in the SERPs, but it'll probably come back down again quickly. That being said, try to avoid using too many keywords in one sentence. A good rule of thumb is 3-5 per paragraph.
Headers & Footers - Headings and footer links are both very useful tools in optimizing your site for search engines. They allow you to group related information together and link to other pages. For example, if you're writing an ecommerce store, you may put all the products' names in your H1, followed by their prices in another H1, and finally linking to category pages in another H1. Your customer wouldn't necessarily know any of this stuff unless he clicked on the product name, but it makes sense to tell him everything he needs to know right off the bat!
Images - Image Alt Text - This is basically the caption that shows up underneath the picture. Most often, image ALT texts contain the same keywords as the images themselves. But remember that search engines generally ignore ALT text altogether.
CSS Stylesheets - In addition to headings and footers, you can also add stylesheets to your webpage. These can alter the formatting of the page itself, making it easier for spiders to index the page correctly. Some examples of common uses for CSS styling are bolding certain parts of the text, changing font sizes, adding color schemes, creating tables, etc. Again, make sure you don't overdo it since it can slow down crawling speed.
JavaScript - JavaScript isn't really part of the HTML code anymore; it's become an integral part of every page. Although there aren't any technical reasons why you shouldn't use it, it's better practice to separate the two. When done properly, javascript allows you to interact directly with elements on your page without having to reload the entire thing.
Backlinks - Backlinks are essentially free advertising. Any time someone else links to your website, this increases the chance that Google will rank you higher. Unfortunately, there's no magic formula for finding out who linked to your site. All you can do is ask everyone you know who owns a blog or website and see if they'd mind linking to yours. Just make sure that none of the links point towards your homepage. Instead, let them lead to articles or specific sections of your site.
Content - Content is king; therefore, if you want to increase your rankings in the SERPS (search engine result page), you should focus primarily on providing valuable and unique content. People love reading blogs and news sites, so if you write great content, you'll naturally attract a lot of readers. Of course, you can use social media to spread awareness of your new content, but ultimately, you need to create original content that users will enjoy.
Conclusion
Search engine optimization is extremely complex and requires a lot of research and testing before you start seeing positive results. Many techniques overlap with others and it can take months or even years to learn enough to begin seeing real improvements. Fortunately, you now have a basic understanding of how search engine algorithms work and how you can improve your own page. Good luck!