Call your voicemail box number -> xxxx to listen to the main menu.
Every Carrier has their own main menu, so check it with your carrier.
An example here:
Choose 2 for the personal settings of your voicemail.
Choose 3 for PIN code and choose a 4 digit code. You can also change your pin code here and indicate when your voicemail should ask for the pin code.
FYI: if you enter an incorrect code 3 times and you will receive a temporary code via SMS. You can change that later.
Which voicemail box number you should call depends on your carrier, the voicemail settings are controlled by your carrier, so contact your carrier.