Mac
Cookie and cache settings in Safari
Safari does not put cookies and cache in one dialog with matching checkboxes. Website data and the cache are opened from different menus, and Clear History often removes site data for the period you pick as well. Read the confirmation before you continue. For iPhone and iPad, use phone browsers.
Remove website data, including cookies
Open Safari settings
In the menu bar, choose Safari → Settings. Older macOS versions say Preferences. The shortcut is Command+,.
Open the Privacy tab
Click Manage Website Data….
Choose the scope
Select one site and click Remove, or click Remove All. The search field filters the list.
Empty the cache
Show the Develop menu
In Safari settings, open Advanced and turn on Show features for web developers or Show Develop menu in menu bar. The wording depends on the macOS version.
Empty caches
Choose Develop → Empty Caches. That drops saved page copies. It is not the same command as clearing all history.
The history command is broader
Safari → Clear History…, sometimes labeled to include website data, often removes history and site data for the time range you choose. Read the confirmation text and decide from that wording.