Hello Jorgito1950,
We understand that the ringer volume for your iPhone is unexpectedly changing on its own. You’re in the right place, we’d be glad to assist in seeking a solution.
To get started, you'll want to ensure your iPhone is fully updated: Update your iPhone, iPad, or iPod touch
To help isolate this further, you can test to see if this continues to happen after removing a protective case, if you have one on your iPhone, and temporarily discontinuing use of accessories (wired or wireless). You can also test to see if this happens or not when Attention Aware features turned off temporarily: About Attention Aware features on your iPhone X or iPad Pro
We look forward to learning what you find out. In the meantime, take care.