If you use iCloud to sync Contacts among devices, then on your Mac go to System Preferences > Apple ID and disable Contact syncing. If you are asked if you want to keep a copy of Contacts on the Mac, then answer No.
Launch the Contacts app on the Mac and ensure that all cards have been deleted. If any remain you can delete them.
Ensure that you contacts remain in iCloud by logging into your iCloud account through the Safari browser.
Re-enable your Macs Contact syncing again in System Prefs > Apple ID.
A fresh copy of your contact cards should reappear in the Contacts app.
As always, you should ensure you have a current backup of your Mac before you do this.