Hi Simonas1991,
We’re here to lend a hand with your iPhone and see what’s going on with the volume. You didn’t mention which iPhone or iOS version that you have installed so we’re going to get started with some good basic steps that may help.
Is your iPhone updated to the latest iOS version? If you have an iPhone 6s or higher, that will be iOS 14.0.1. See Update your iPhone, iPad, or iPod touch for more details.
If you have a case or screen protector, have you tried to remove it and test to see if the issue persists?
Depending on which iPhone you have, you may or may not have this feature, 'Attention Aware Features'. But do check to see, and if so, turn this feature off and then test for the issue. See About Attention Aware features on your iPhone X or iPad Pro for more information
Do you use a wired or wireless accessory with volume control buttons with your iPhone? If you do, test with the device(s) unplugged or unpaired from the iPhone.
Next, check and see if Settings > Sound & Haptics > Change with Buttons is enabled or disabled? If this setting is changed does the behavior change?
Cheers!