Cosleeping

I’m a single mom and just recently got out an abusive relationship, I’ve been sleeping with my baby because it’s the only way I get sleep, and it also brings me comfort. He’s 6 months old now, and I was wondering how you guys got your baby to sleep on their own?