How do you co sleep with a toddler

Thinking of trying co sleeping with our toddler (20 months) so we can all get better sleep. But how do you do it. When toddler goes to bed before you do how do you insure they don’t roll off the bed? Do you put them in their own bed and then transfer them when you go to bed? How do you insure their safety when you are sleeping? FTM lol