The Voicemail feature is provided by your cellular service provider/operator and each of them have a different specific setup.
Generally, these are the steps to follow on iPhone:
- Launch the Phone app. On the bottom right, you will see the voicemail icon.
- Select it to open voicemail setup.
- Click Set up now in the center of the screen.
- If you have previously used iPhone voicemail, you can enter the old password and access voicemails automatically.
- But if you haven't used voicemail before, you must make a password and re-enter it.
- When the process is finished, choose “Done”.
- After that, your phone will show the Greeting screen. You can choose Default and then Done, if you want the carrier's default Voicemail greeting.
- But if you wish to personalize/customize your greeting, you can select Record menu to record the greeting and also Play to repeat it back.
- When you're satisfied with the recording, select Done.
That's it!
Also on this article from Apple, if your carrier offers Visual Voicemail, Set up Visual Voicemail on your iPhone - Apple Support