You should not do this on a bed. Do it on the floor. You may fall of the bed, the keys may fall of the bed, you may be tempted to stand and try to reach the keys, which is dangerous. Just do it on the floor.
Find a place on the floor where you can connect yourself to something fixed, for example the tubes of the heating system, or the hinge of a door. Do not connect yourself to a cupboard or wardrobe. Things may fall out of it when you struggle, or the cupboard itself will fall on you. You can connect yourself either by your ankles, or with a chain around your neck. Without connection, you may start crawling around and looking for your toolbox, which we don't want.
Use a blanket that is folded a couple of times, with a sheet on it. Even carpet that seems soft, can graze your skin severely when you struggle. Also, if the keys fall out of your reach, the blanket can help you to get them within your reach. Make sure that the keys will fall close to your hands, but not on you. Be absolutely sure that you will be able to reach them.