If you're using the Google Contacts app on your Samsung phone, you can restore phone contacts using the methods above. But there are a few other options.
If you've backed up your contacts via the Samsung Cloud app, go to "Settings -> Samsung Account -> Samsung Cloud -> Restore Data (choose your device when prompted) -> Restore." You can opt to manually back up your contacts at any time by opening Samsung Cloud and tapping on "Back up data."
Alternatively, open the preinstalled Contacts app on your Samsung phone. Tap "Contacts," followed by the three-dot menu. Select "Trash" and long-press the contact you want to restore. It works nearly identically to the Google Contacts app for restoring deleted Android contacts.