Hello markw241,
Thank you for posting in the Apple Support Communities. I understand that Clear History is grayed out in Safari, and I’d like to assist you.
First, open System Preferences > Screen Time > Options, and check if Screen Time is enabled. If it is, open Content & Privacy, then check if Web Content is set to “Limit Adult Websites” or “Allowed Websites Only.”
If Web Content is limited, try deselecting those options. You can also try going to Safari > File > New Private Window, then try going to Safari > Clear History. From there, head into Safari Preferences > Privacy > Manage Website Data > [Remove / Remove All].
I hope this information is useful. Kind regards.