Tips for safe co-sleeping?

pe

My lo has a stuffy nose the past few days due to the change in season so he won’t sleep on his own. At all. Which means that I haven’t been sleeping. At all. I was holding him last night and we ended up falling asleep in my bed. We slept for over 5 hours straight and neither one of us moved the entire time. It was great. I feel really bad because they always tell you not to do it but I know people DO co-sleep so I was wondering about how to do it safely. Just until his nose clears up and he’ll sleep in his crib again