While syntactically user_0 helped you, it appears from your comment that you are still not sure what an index does all together.
The way I have gone about understanding indexes is by comparing them to their uses in books.
Indexes are designed to help the reader find information quickly and easily. A complete and truly useful index is not simply a list of the words and phrases used in a publication but an organized map of its contents, including cross-references, grouping of like concepts, and other useful intellectual analysis.
Wikipedia
So suppose you need to know more about Primary Keys
(PK's) in Mysql and you pick up your trusty Mysql book nearby. You have no idea where in the book PK's are discussed. You would then go to the index at the back of the book. This would point you directly to the right place(s) that PK's are discussed in the book while saving countless amounts of hours perusing through the book.
Indexes in databases work in a very similar way. You can get at the millions of rows of data that you are looking for with the right index in seconds. Also, just like it would take awhile to go through and compile an index in a book, it takes time to create an index on a table. Just like erasing an index from a book takes but a few seconds and the index is forgotten, same goes for dropping an index on a table in a database.
For more info:
Detailed stackoverflow answer on how indexing works.
Wiki Database Indexes.
Indexes in Mysql.
Postgres Indexes