I have gone through the same thing, and I have been delivered from it through the might Grace of God/Jesus. When God removes things from your life, it is frequently done to remove your dependence on these things / (God substitutes). He is calling you right now to step out of your self based fear/depression, and to turn your eyes to Him, via prayer and getting into the word (look to the Psalms, David went through a similar lonely struggle when he was hiding in caves from king Saul. Check out psalms 103 116 149 139 107.
Life is brutiful, both brutal and beautiful, simultaneously depending on how you look at it in any given moment. I sense you are very lonely as well. I was a total recluse, and it was difficult for any encouragement as such to help until I sought the fellowship of other believers. You have not lost the ability to attend Church services, that is simply not true. I am a Christian, and I am your friend, feel free to reach out anytime. I am in recovery and attend AA meetings, and have great fellowship with the believers in that program too. These programs can be helpful if you feel like Christians don’t understand you, because of a specific sin.
Remember, that God love is constant, and he loves you right now, with the same love that He loves me, i.e. as much as He is able. You need to get out of yourself. Ego is not just pride, it can also be depression or self based fear. Let it go, right now, and turn to God, and give Him thanks for your trials and His forgiveness, and ask Him to lead you into fellowship with other believer. Love always, Peter, a servant of the Lord.