When we talk about self gratification we are in a different place than the world is. Gods call on our life is to be Holy, because He is Holy. He is in us by His Spirit, and what burns in Him naturally burns in us.
Jesus is the model for sexual purity. In 1 John 2:6 it says “The one who says he abides in Him ought to himself to walk in the same manner as He walked.” At a weak moment when Christ was tired, hungry, and lonely He was offered everything the world had. He turned it down, because He knew who He was, who His Father was, and where He was going. He could not be bought.
Jesus was rejected by his people, misunderstood by His brothers/friends, abandoned by his parents (forgetting Him in Jerusalem for a day). He had every opportunity to sexualize His need, numb/control the pain of rejection and misunderstanding.
We can’t imagine Jesus getting his feet wiped off with a women’s tears, or perfume and looking down her shirt, seeing her breast and thinking to himself “I am really wanting to do some very unholy things with this woman! But people are looking up to me. I am the religious leader around here, I can’t do it, but I want to do it, but I can’t, but I want to…..Oh,..wait, I have a better idea. Hey you guys, you wait here, and I am going to go off alone to masturbate……I mean pray.”
We know that scenario is not true because a man who sweats blood would not masturbate. He was without sin. Paul defines it well in Ephesians 5:3 Among you there must not be even a hint of sexual immorality. Jesus set the standard on sexual purity for us to follow. Be Holy as I am Holy.