My daughter is 27 months. We co-slept until shortly after her 2nd birthday. We moved her to her own bed just a few days after her birthday. That effectively nightweaned her. While we were co-sleeping, there just wasn't any way. She was old enough to help herself. And even if she wasn't helping herself, I would automatically offer the breast when she fussed in her sleep. She has taken to the process very well. In fact, I couldn't believe how easy it was since we'd been doing the bulk of our breastfeeding at night for the past several months prior to that.
I think it's best/ easiest to wait until the time is right. But you won't know if it is until you try. My daughter was a VERY willing nighttime nurser. The first night I laid her in her own bed, I thought there was no way she was going to go for it. She needed her boobs! But she did so well. That's not to say that she never wakes up in the middle of the ni8ght to ask for boobies. She still does sometimes. But I find that if I feed her closer to bedtime, or if I offer her a small snack (possibly in addition to a little nursing) right before bed, then she is much more likely to sleep the whole night through. Perhaps that might be something to try if you're going to continue co-sleeping too. You could offer her a snack and one final nursing session, then wear inconvenient (for nursing) clothing to bed and try your best to distract her when she asks to nurse.
Good luck with whatever you decide. You're most certainly not a failure. Your breastfeeding relationship is fluid and adaptable. If your child needs to continue the same amount of breastfeeding as before, then they will start to make up for it with daytime feedings. At which point, you can decide how much you are comfortable with. (Though I'm not sure how old your little one is... and that would make a difference to me.)
Big

to you. I know its hard to make a decision like this. Even though co-sleeping and breastfeeding at night offered us more rest in the beginning... When it came to doing it with a toddler, I found that the act of constantly moving and catering to her nursing needs throughout the night was keeping me from getting a full night's rest. Attending to a night-nurser meant never fully falling asleep for me. There has to a level of consciousness there in order to move and offer the breast-- even if you don't remember it. I can definitely feel a difference now between sleeping on my own and and the nights that she comes into my bed (to nurse). Of course that doesn't mean that it won't work for many people, that just means that if
you feel the need to cut it off... it's perfectly understandable and okay.

ETA: So my vote was for 24+ months... But that would specifically be 24 months
in a separate room. There was no bed-sharing and nightweaning for us. It just wasn't happening.