Before you start, you need to confirm that your website supports this feature.
One quick way to find out is to login to your FTP and go into your public_html or www folder (where you upload your web pages) and see if there is a file named ".htaccess". If there is then your website probably supports this.
The other way is to write to your hosting company and ask "Does my hosting package support .htaccess files?" or "Is my website hosted on an Apache web server with mod_rewrite?".
After you make sure your hosting package supports this, go to your wordpress admin panel and go to:
Options > Permalinks
On this page, fill in the fields like this:
Please note that, you can write:
/category
on "Category base" if you want, that is, it's a matter of your preference. Same with the "Tag base" field but for "Custom structure" you must write:
/%postname%
Now, click on "Update Permalink Structure".
Finally, there is a code at the bottom of the same page. Go ahead and create a new text file and copy and paste the code into it. Then save your file as .htaccess and upload it to your website, where you uploaded the Wordpress.
That is if you uploaded the Wordpress in:
public_html/blog
You will have to upload the .htaccess file you just made into:
public_html/blog
Your blog should be search engine optimized
Happy blogging