Help my 1 year old dont sleep through the night


Hello mamas,sorry for long post but I need help. I know this is a subject that other moms dont like but my baby doctor told me to do this the cry it out method. Has there been other moms who have tried this and has it work? How long did it last? And do you do the same for naps also? So my baby just turned 1 on the 28th of july and she still dont sleep through the night. She would wake up every 3 hours to just scream and cry she was in my room next to my side of the bed. But at her 12 month check up told the doctor that I was not sleeping and the doctor could see my face how I was done and frustrated l. She said it's time to take her out of your room and into her room. Well last night was the first night that I did it, and it was the hardest thing i had to go through beside giving birth. Today she has been so clingy and crying all day she only wants to sleep only on me. I have to keep up with the sleep method but I need to see if other moms have done this. And please no judgement her doctor told me to do it and it should only take 3 days.