Watch how to remove a Configuration Profile:Un-Enroll a MAC Profile
...
Here's a step-by-step guide to remove a configuration profile on a Mac:
Open System Preferences or System Preferences:
Click on the Apple logo in the top-left corner of your screen.
Select "System Preferences."
Navigate to Profiles:
In the System Preferences window, find and click on "Profiles.""
In Sonoma go to “Privacy and Security” then scroll to the bottom to locate “Profiles”
Select the Profile to Remove:
You'll see a list of profiles installed on your Mac. Identify the one you want to remove.
Remove the Profile:
Click on the profile you want to delete.
Look for a "Remove" or "Delete" button, usually located at the bottom.
Confirm that you want to remove the profile.
Enter Your Password:
You might be prompted to enter your Mac's administrator password. Do so to proceed with the removal.
Restart if Required:
Some profiles may require a restart to complete the removal. If prompted, restart your Mac.
...