4 month old won't stay in a cot

So I just wrote a post that did not make any sense so here I am re writing it 
Basically my baby girl won't sleep in a cot the first night I put her in she cried for 5 mins I would pick her up calm her down then when she was drowsy put her back but then she would cry again so I ended up doing this all night until she got fed up of me putting her in and out of the cot that she cried for 10 hours till next morning because she didn't want to sleep she did have a few hours sleep as in the end I gave up and put her in the bed with me does anyone have any advice for me so she will sleep in the cot?