It all depends where your contacts and message data were stored. It sounds like they're not stored on your current SIM card, so they could still be on your old phone's memory or possibly in some sort of cloud storage (like iCloud for iOS or your Google account on Android for example).
If your data is still stored in a cloud, syncing your account is all you'll need to do.
If the data is stored on your old device, you will need to transfer it to your sim card. Different phones have different ways of saving data to a SIM card, so check out the documentation or follow the on-screen instructions.