A hot topic.
In answer to your question, masturbation is not explicitly mentioned in the Bible.
If you are refering to whether it’s the right thing to do or not, then the Bible implicitly
teaches it’s not the right thing to do.
This is based on Jesus’ sermon on the mount in Matthew 5 - 7.
In Matthew 5:27-28 Jesus says
“You have heard that it was said, ‘Do not commit adultery.’ But I tell you that anyone who looks at a woman lustfully has already committed adultery with her in his heart.”
The problem with masturbation is that it is associated with sexual fantasies that can easily lead to lust - especially if the object of the fantasy is someone real or someone you know. In these circumstances masturbation, by Jesus’ definition, is a way of committing adultery.
So masturbation in and of itself is not condemned by the bible but when it leads to sinful and unhelpful thoughts it is not good. It is better to resist temptation, asking God for help and strength, than giving in to it.
However if you do give in and lust in your mind, it is not a sin that is beyond God ability to forgive. Ask God for forgiveness and seek to avoid that situation again.
Hope this helps.