As suggested by Will, you can try to take the volume button out to see if it will fix. However, if this does not work, you may have to replace the button. Luckily for you, Apple has created a software where you can tell your phone to do things, without touching any physical buttons. This is called Assistive Touch, which you can easily enable in your settings app. Here are some way to get to assistive touch.
Go to Settings > General > Accessibility > AssistiveTouch, then turn on AssistiveTouch.
Tell Siri “Turn on AssistiveTouch.”
Go to Settings > General > Accessibility > Accessibility Shortcut and turn on AssistiveTouch.
Once you have turned on assistive touch, you should see a small black square with a white circle in the middle. You can move this to any side of your screen and one tap on this button will open up many different options that you can ask your iPhone to do. The volume up button that you are looking for is in the "device" icon. The volume up and down buttons are located in here, which you can use just by pressing on either button.
Hope this helped,