You can set it up with these steps:
Go to the Phone app, then tap the Voicemail tab.
Tap Set Up Now.
Create a voicemail password, then tap Done.
Enter your password again to confirm it, then tap Done.
Select Custom or Default. If you choose Custom, you can record a new greeting.
To transfer your existing voicemail, follow these steps:
Go to the Phone app, then tap the Voicemail tab.
Tap Set Up Now.
Enter your password,* then tap done.
Record a custom greeting or use the default greeting, then tap Save.
If you forget your voicemail password, there's no way to reset it from your iPhone.
If you insert a new SIM card, you might lose the voicemails that you saved on your iPhone.