The worst thing in life isn't to end up all alone. The worst thing in life is to end up with people that make you feel alone. You shouldn't have to beg for things that should be freely given to you like love and affection. Resentment develops when you repeatedly feel unheard, dismissed or feel that your spouse puts other interests ahead of you and the marriage.
Research suggests 60% of people that suffer from loneliness are actually living with their spouse. It might hurt to walk away but that will never compare to the pain of staying. Don't let the fear of being alone keep you in a relationship where you are alone.
You need to decide. Is this the life you want to live?. Is this the person you want to love?. Is this the best you can be?. Can you be stronger? kinder? more compassionate?. Decide, breathe in, breathe out and decide.