Like a Murphy Bed?
There’s special hardware kits for that and they’ll include instructions.
Hi K4. Are you talking about a Murphy bed that goes up into a wall cavity? Here are some sites I found regarding them, hope they help.
Take a look at them all and see what works for you. You can do this, I have faith in you! Good luck
Here is info on a Murphey Bed:
Murphey Bed for $150: https://www.yourmodernfamily.com/diy-wall-bed/
Farmhouse Murphey Bed: https://addicted2diy.com/diy-modern-farmhouse-murphy-bed/