You want to avoid anything smooshy if you're co sleeping, so don't put him down on your duvet with cot mattress on top, your own mattress is safer (so long as it's not smooshy memory foam). Is your bed against the wall? What's between him and the edge?
Keep the duvet round your waist or sleep in onesie/cardigan/dressing gown.
You could get a co sleeper cot, second hand ones are safe and quite cheap, you just need a new mattress.
Sometimes co sleeping is the only way and it's safer than no sleep. If you can't sleep at all then I'd talk to your hv, extreme sleep deprivation is not good for your mental or physical health.
Sometimes it helps to put something of yours (t-shirt etc) under the Moses basket sheet so it smells of you, warm it with a hot water bottle before putting him down, hold him for five mins so he's properly sleep when you put him down, lightly press your hand on his tummy when you put him down for a minute so he feels like he's still being held, then gently release. White noise is good too (you can get free apps with it).
Good luck, it gets better when you're out of the initial chaos!