Hey there!
I understand your concern. First off, Mac’s are the most secure devices in the world. I truly believe that. The big question is, did you provide these people any personal information? (Account or network passwords, social security numbers, banking information)?
If not, then you should be fine.
Can you say what, if any software was installed for them to access your Mac? Of course with permission they can, but access always requires your approval, depending on the access that was allowed.
If you didn’t provide any personal information, I’d focus on any, of any, third party software that was installed on your Mac.
First, starting in Safe Mode is a good step:
Start up your Mac in safe mode:
https://support.apple.com/guide/mac-help/start-up-your-mac-in-safe-mode-mh21245/mac
While there, I’d open:
System Preferences > Users and Groups > Login Items.
These items are set there to open when you log in.
If you don’t recognize something there, you can remove it by highlighting it, and pressing the “-“ below.
Then I would restart your Mac normally.
Other than that, you should be fine, depending on what (If anything) was installed, there are other settings and places to look for malicious software, just let me know.
99% of these people just try to scare others, to pay them to fix the “problem” even when there is no problem, and they tell you there is one.
Otherwise, they do the same to try to pull your accounts information from you.
So 99% of the time, especially on Apple products, You never have to worry. But let me know exactly what, if anything, was installed.
Otherwise, if you did provide any personal information, that’s what’s important. If bank information, contact your financial institution. If any account information, change your passwords and update security to Two Factor Authentication:
Two-factor authentication for Apple ID:
https://support.apple.com/en-us/HT204915
Otherwise, if you did t install anything or give any personal information, these articles may help:
Recognize and avoid phishing messages, phony support calls, and other scams:
https://support.apple.com/en-us/HT204759
Identify legitimate emails from the App Store or iTunes Store:
https://support.apple.com/en-us/HT201679
It’s unfortunate what’s going on nowadays with all these scammers, agree 100%, and it does make me upset. So staying up to date on account and device security and knowing what’s out there is number one. One thing I know, if I want a device or account to be secure, there’s no other company I trust more than Apple. Sounds corny, but I’ve seen the alternatives.
Good luck! Let me know if you have any questions, and if you still are concerned, give them a call:
Contact Apple for support and service:
https://support.apple.com/en-us/HT201232