There are some ways to recover contactc from samsung galaxy.
1.Google account, if you have signed up a google account, and opened the sync in the phone, it will sync your data including contacts in the phone to the server, so you can recover contacts by signing in google account.
2.PC companion, when you buy a new android phone and connect it to computer firstly, the phone my remind you download and install the official PC companion to computer as to manage your phone, and the PC companion applicaiton has a "automatically backup" when you connect the phone to computer, so you can try to find the backup for your phone.
3.Sim card, I don't know whether you have a habit that making a copy of contacts or SMS to sim card. Actually, although android phone do not have the function of "auto save in sim card" when you save a new contact to phone, but you can make a copy for your contacts by some apps or the backup feature in the contacts log.
4.3rd-party android phone assistant, nowadays more and more 3rd-party android phone assistant are used by android users,and these applications are similar as offiicial PC companion, it can help you manage your android phone on computer, so they has a auto backup feature as well, if you have installed the application to your computer, you can try to recover contacts via it.
5. Recvoery program, if you do not have any backup, you can try to recover data in the SD card of your phone, know more here: Samsung Galaxy data recovery