Castration for SSA is like crashing your car into the side of a mountain because the “check engine” light is on.
SSA IS NOT SINFUL. I do not have SSA, but I am attracted to members of the opposite sex. Attraction is not a sin, acting on it inappropriately is. Example: I am attracted to my spouse. I can do things about that with him. I am also attracted to Hugh Jackman. My options are limited to one: Thank God for his creations and move on and not hand my brain over to thoughts about someone I am not married to!

In short: Castration would be just as appropriate for a straight person as a person with SSA.
Also, it’s not guaranteed you’re gay based on these claims. Heterosexual people go through what you describe as sexuality really
is a spectrum. Just because you may feel this way doesn’t mean you;ll never meet, fall in love with, and marry someone of the opposite gender, especially if you are young. If you are so disturbed by it that you think castration is a solution, speaking to a counselor would be a BIG help.
When it comes to withstanding temptation I’d give you the same advice I’d give myself or anyone else because we do have a one-size-fits-all solution: Jesus Christ. Run to him and make him the center of your life. Fall in love with God deeply and passionately and let him fill the desires of your heart and everything else, even our own sins and temptations, start to fade from view as he starts to heal our hearts. Mutilation, self-hatred, punishments, torments, even fasting (for the wrong reasons) cannot drive out the darkness in our hearts, only Jesus can and ONLY drawing closer to HIM and filling our hearts with love can drive it out. Whether you’re tempted by homosexuality, murder, lying, or fudging numbers on your taxes. It doesn’t matter.
Sending you lots of love in Christ. <3