My LO has slept through the night (mostly, of course we have the odd night where he will wake once) since he was about 3 months old, he’s now 6 months. Although now I’ve said that it will stop!
I’m a big believer that they do it when they’re ready and luck of the draw has a huge role to play!
The other thing that I think made a big difference was that I held/had him in a sling for every nap (I’m the next to me at night, we’ve never coslept) until he was ready to be put down. He has only recently started to go in the cot for day naps. I think he was so sick of me by the end of the day, he was happy to have his own space! Of course it wasn’t easy at times, but I could cope with him on me in the day if it meant I could sleep at night.
But in all seriousness, he’s never been put down without wanting to be so now he’s quite happy to be put down because he knows I will be there if he needs, it that makes sense!
Of course I understand that this approach isn’t for everyone, but it worked for me so may work for others! Don’t buy into all that ‘holding them spoils them, they’ll never go in the cot’ crap.