I made sure the mattress was the same height as my bed mattress. Pushed the cot right up against the bed and made sure it couldn't move (you might need to use bungee cords or similar, but I have a solid wood cot on carpet floor, I can't slide it so I doubt it will move by accident). Then used a bath towel rolled up tight to fill the slight gap between the mattresses (I had to do this because both beds have a slight ridge keeping the mattresses in place so while the beds are pushed up tight there's a small gap between the mattresses). If you want you can then put a sheet across the cot and bed and tuck in tight to keep everything in place.
Any opinions, advice, statements or other information expressed or made available on BabyandBump.Momtastic.com by users or third parties, including but not limited to bloggers, are solely those of the respective user or other third party. They do not reflect the opinions of BabyandBump.Momtastic.com and they have not been reviewed by a physician, psychologist or parenting expert or any member of the BabyandBump.Momtastic.com staff for accuracy, balance or objectivity. Content and other information presented on BabyandBump.Momtastic.com are not a substitute for professional medical or mental health advice, counseling, diagnosis, or treatment. Never delay or disregard seeking professional medical or mental health advice from your physician or other qualified health provider because of something you have read on BabyandBump.Momtastic.com. BabyandBump.Momtastic.com does not endorse any opinion, advice, statement, product, service or treatment made available on the website. If you think you have a medical emergency, call your doctor or emergency services immediately.