You can recover your contacts through Facebook, the cloud, your Google account or simply by reaching out to your contacts in person. The appropriate method depends on which devices and services you have.
Sync your iPhone or Android with Facebook to get phone numbers from friends who put them on their profiles.
If you're a Windows phone user, you can save your contacts to your Microsoft account in the cloud. This permits you to keep your contacts between all of the places you sign in with that information, such as a desktop, tablet or laptop in addition to the phone. Making changes in one place causes those same changes to occur in every place, which means that you only need to type the contact information into one device.
Saving contacts into your Google account also allows you to retrieve them later. Just add the Google account to the new smartphone, and then sync the phone before waiting for the contacts to appear. Cloud storage is the best way to bring that information back quickly.
There are some old-fashioned methods as well. Calling or emailing people and asking them for their contact information is one option. If you maintain a written address book but do not have cloud storage, use the information from that book to program your new phone.