I get this question a lot, and I clean up a lot of computers after users use a cleanup tool.
Anyhow, this article has it explained simple and quick, and even shows what to do if you want to really speed up your PC.
Defragmentation is automatically scheduled in Windows Versions newer than Vista.
I want to remind you, that the best way to keep your PC running fast, is not to have unnecessary programs, making sure it is up to date, and running antivirus and antimalware often.
Computers will get a little slow over time, just because the Operative System (Windows/OSX/Linux) has updates and gets heavier, but also because our perception of what a fast computer is.
10 years ago web pages were 10 time smaller than they are now. So even web browsers are getting heavier.