1. Click on Safari in the left corner of the top bar and choose Preferences from the drop-down menu:
2. Click the Privacy tab and then click Manage Website Data:
3. In the window that appears, click Remove All, and in the next Done:
4. Reboot Safari for the changes to take effect.
Clearing the cache will cause websites to take a little longer to open, which is normal because Safari re-caches the cache, and after clearing the cookies you will need to log back in to some online services.