If you want to defrag your hard drives in Windows 8 you can still use your O&O defrag software or you use the built-in tools. Works exactly like it did in Windows 7 (last update: Developer Preview)
how to defrag Windows 8

Tip: There are many nice defrag tools for Windows 7 that all work on Windows 8 e.g. Defraggler

Using The Built In Windows Defrag Tool

While the built-in defrag tool is a great addition, it also relatively slow and there are tools out there that get the job done in less and can significantly speed up your hard drive
Never ever defragment your SSD (solid state drives)

1. Step Open the Windows 8 explorer

Click here to join Ultra.io - Rare NFTs and Play-to-Earn Games or Read my review first!

2. Step Right-click on the hard drive that you think is fragmented and click on Properties
Open hard drive properties in Windows 8

3. Step Go to the Tools tab and click on Optimize now at the bottom:

defrag tools in Windows 8

4. Step The built-in Windows 8 defragmentation program opens. By default, Windows 8 schedules a weekly disk defragmentation. So, even if you have not defragmented your disk, Windows 8 might have done it for you and your disk might not even require a defragmentation.

5. Step Select the drive that you want to analyze and click the Analyze button

Windows 8 will analyze your hard drives and will let you know if you should defragment it.

If you want to defrag Windows 8 professionally you can also try tools like O&O Defrag the leading defrag software for Windows PC’s. Windows 8 supports most if not all Windows 7 defrag tools.