I looked for this on various websites including youtube and solved it using to work volume buttons on your iPhone. but there are some steps you can take to try and fix the issue:-
1. Check for Physical Damage:- Inspect the volume buttons and the area surrounding them for any signs of physical damage, such as debris, dirt, or liquid. If you find any, gently clean the buttons and the surrounding area using a soft, lint-free cloth.
2. Restart Your iPhone:- A simple restart can sometimes resolve temporary software glitches that may be causing the volume buttons to malfunction. Press and hold the power button until the "slide to power off" slider appears. Slide it to power off your iPhone, then press and hold the power button again until the Apple logo appears to turn it back on.
3. Try Adjusting Volume in Settings:- If the physical volume buttons aren't working, you can try adjusting the volume in Settings. Go to Settings > Sounds & Haptics (or Sounds) and use the slider to adjust the volume. If you're able to adjust the volume using the on-screen controls, the issue may be with the physical buttons themselves.
4. Check for Accessibility Settings:- Sometimes, certain accessibility settings can affect the behavior of the volume buttons. Go to Settings > Accessibility > Touch and make sure "AssistiveTouch" is turned off. If it's on, try turning it off and see if the volume buttons start working again.
5. Reset All Settings:- Go to Settings > General > Reset > Reset All Settings. Keep in mind that you'll need to reconfigure any customized settings after doing this.
Follow for more further assistance below.