The way I did it with my eldest was that I had him beside the wall. I had his ownn set of blankets and everything so that any movement I made with mine didn't affect him. I also moved my pillow down a little to make absolutely sure my blankets would not accidentally interfere with him.
I put rolled up towels at the edge of the bed beside the wall so there was no way he could accidentally get a leg or arm slipped down beside the bed and wedged.
When you suss it all out, and get confident with it, it really works amazingly well, and is an absolute life saver as far as sleep and peace of mind goes.
There is an amazing book called "three in a bed" all about co-sleeping.
Dr James McKenna is a sleep researcher and co-sleeping advocate, I love this article of his: Babies need their mothers beside them
Safe co-sleeping guidelines: