We don't know each phone on the market, but in general the following steps may be useful:
To change your voicemail password, from the Phone app select the Keypad tab then select the Visual Voicemail icon.
Note: To access the Phone app, from the home screen select the Phone app or from the lock screen swipe up from the Phone icon
Select the Menu icon, then select Settings
Select Change password, then follow the on-screen instructions.
Alternately, you can change your voicemail password using the voicemail interactive voice response (IVR). Select and hold the 1 key > enter your existing password > 4 key > 2 key> 1 key > 1 key > enter your new password.
Note: To change your voicemail password via the IVR, you must know your current voicemail password.
If you have forgotten your existing voicemail password, you will not be able to access Voicemail until you reset your voicemail password.