On your desktop go into help and support and type in defrag and a menu will pop up that tells you how to do it. You can schedule it to run regularly on a weekly basis.
or you can download this one free. it's called "DEFRAGGLER" and it's much faster than the one MS has built into the computer. it updates regularly. they ask for a donation, but it's not necessary and they don't slip in ads, etc.