When I was younger I masturbated very frequently and what strikes me in retrospect is how often I masturbated in order to *escape * from a difficult emotional state or to fill the frequent feeling of inner emptiness I felt at that time. Perhaps you could reflect on your emotional life and ask yourself if you are in some way unhappy? If so then what in your life would you wish to be different? How can you fill the empty place in yourself in a meaningful way? I have found that with this kind of self-reflection it is helpful to do it with a person you can trust.
Of course, sexual feelings are intrinsic to being human and it is natural that at times an inner pressure can build up that tempts us to masturbate. If you do succumb then, well, don’t be too hard on yourself - sexual maturity is a process and with some effort, a lot of prayer, and the unflagging attempt to be compassionate towards yourself you’ll grow towards it.
Remember: you’re trying to choose the good against the less good - genuine intimacy with another as against a loveless - if pleasant - physical experience. Perhaps you could think of your struggle not so much as trying to stay on the right side of a God who doesn’t want you to enjoy life but rather as an attempt to let go of something lesser in order to obtain something much, much better - to fully experience the joy that God wants for you.
I hope that helps.