You looked up a present, or a medical question, on a shared computer. There is no need to throw away months of history to remove ten minutes.
Safari menu bar: History > Clear History
pop-up menu: choose how far back
Choose the shortest range that covers what you want gone, then confirm. I’d always check that pop-up before clicking, because whatever it shows is what you’re about to lose.
Clearing does more than empty a list of pages. Safari also removes things such as recent searches, website icons, the frequently visited list, the list of downloads (the files themselves stay) and permissions that sites asked for, such as location or notifications.
If your devices share Safari through iCloud, the history disappears from all of them. That is handy when it’s what you want and a nasty surprise when it isn’t.
It only cleans your side. Websites keep their own records, and your network or employer may too. For something you know in advance you don’t want stored, open a private window and skip the cleanup. And there is no undo button here, so if you rely on history to find old pages, bookmark the ones you can’t afford to lose first.
Further reading: Clear your browsing history in Safari on Mac
Going deeper: Guide: run your own search engine with SearXNG and make it the default on your iPhone and Mac