How do I delete unused data?
If you're talking about materials or textures:

In the Node Editor, all the materials that have a "0 something" name have no user, it means that they are not used by any object and that they will automatically be deleted when you'll close the file.

You can delete them for good immediately if you go to the Outliner panel, select Orphan Data in the dropdown menu, then select all the materials displayed in the materials category and right click > Delete.

If you want to delete materials that have users, select them one by one in the Node editor and click both on shift and on the "X" button on the right of the material name. Now they will have a "0" displayed in front of their name, so again, they will be deleted when you'll close the file, or you can delete them right away in the Outliner. 

After deleting materials, if some images (those that have been used by some materials) are also displayed in the Outliner > Orphan Data > image category, again, select them all and right click > Delete.

If you already know by their name the materials and images you want to delete you can directly go to the Outliner then select Blender File in the dropdown menu and Delete all the unwanted materials and images.