The gentle way yo do it is to start of breastfeeding to nearly asleep (not fully asleep) and put baby down in the cot before asleep.
There's a technique to doing this, it's not a simple matter of "Just put baby down" initially.
(1) With baby in a breastfeeding cradle hold, unlatch and wait to make sure baby is calm and not about to start crying. Give it a good few minutes in your arms (pref still, because rocking creates additional problems)
(2) once in your arms, unlatched from breast, calm but not fully asleep, go to the cot. Cot sides are a problem here. Ideally a sidecar cot is easiest (one side removed off the cot and wedged up to your bed) because there is no leaning over cot sides.
(3) with baby in your arms, bend at the waist make it to that you lower to the cot mattress with baby not moving relative to you. So baby stays in cradle hold at your chest while being lowered with you. By the time baby touches the mattress you want to be parallel with the mattress yourself, still holding baby to your chest. Not sure how well I've explained that?
(4) as baby is laid on the mattress, you stay close and start some shushing.
(5) place your hand on baby's chest quite firmly - your aiming to replace the weight of your body/presence with your hand.
(6) wait. Stay completely still at each stage, shushing if needed. Don't be afraid to go back up the "steps" if baby is distressed and start again. Don't move on to next step until baby is calm
(7) slowly pull your body away as baby goes to sleep in the cot, but leave your hand there.
(8) gently pull your hand a way and leave once baby us in a deep sleep
Slowly, over time, you start the process with baby a little bit more awake each time. The ultimate aim us yo breastfeed baby away from the room they will sleep in, then put down while fully awake and baby settles by usingypur hand on their chest for reassurance. It's a long, slow process to get there though.