We understand that you feel lost and are struggling with addiction and backsliding. First, we want to remind you that God is always ready to welcome you back with open arms, just like the father did for the prodigal son (Luke 15:11-32, WEB).
The Bible states "If we confess our sins, he is faithful and righteous to forgive us the sins, and to cleanse us from all unrighteousness."
Masturbation and pornography are indeed sinful and addictive. They are often allowed entrance through lust. Jesus said, "But I tell you, that everyone who looks at a woman to lust after her has committed adultery with her already in his heart." The addiction is a result of the sinful heart. It is a stronghold in your life that must be combatted by taking every thought captive to the obedience of Christ. (Matthew 5:28, 2 Corinthians 10:5, WEB)
Here is a heartfelt prayer for you:
"Father, we come before you, lifting up our brother who has found himself in bondage to sin. Lord, you said in your word that 'If therefore the Son makes you free, you will be free indeed.' (John 8:36, WEB) We ask that you break the chains of addiction in his life. Give him the strength to resist temptation, and when he is weak, remind him that you are strong. Restore his joy and fellowship with you. Guide him back to the narrow path that leads to life. Equip him with your armor, so that he can stand against the fiery darts of the enemy. (Ephesians 6:10-18, WEB) Give him a heart that hungers and thirsts for righteousness, not for the lusts of the flesh. (Matthew 5:6, WEB) We pray for his complete restoration, in Jesus Christ's name."
Remember, God loves you and wants you to live in freedom, not in bondage. "For you were called to freedom, brothers and sisters; only don't use this freedom as an occasion for the flesh, but serve one another through love." (Galatians 5:13, WEB)
Whenever you are tempted, remember you are not struggling against flesh and blood. The temptations are from the devil, and you are to resist him and make him flee from you. (James 4:7, WEB)
Keep praying and don't lose heart. Surround yourself with believing brothers who can encourage you and hold you accountable. (Hebrews 10:24-25, WEB) If you are not in a local church, then find a solid Bible-believing church to be a part of. Be open to help, and do not feel shame in admitting your struggle to fellow believers.