The Bed is an item craftable at a Sawmill. To craft one, you need 5 Silk (7 Cobwebs for 1, 35 for all 5) and 15 Wood. The Bed allows you to set your spawn point wherever the bed is placed. Your spawn point will be reset if the bed is destroyed.
For a Bed to function properly and allow you to set your spawn point, certain criteria must be met similar to room requirements for spawning NPCs:
The Bed must have enough space. A 7-block wide and 5-block high (interior) room is minimum, as such a 9-by-7 box overall is required. For ease of placement, this is the full lateral reach of a player, with the maximum vertical reach.
All In-Game Bed Sprites: 1st Row Left to Right - Bed, Rich Mahogany, Boreal, Ebon, Shade, Pearl, Palm 2nd Row Left to Right - Living, Cactus, Mushroom, Honey, Pumpkin, Frozen, Slime 3rd Row Left to Right - Glass, Flesh, Dynasty, Bone, Pink Dungeon, Green Dungeon, Blue Dungeon 4th Row Left to Right - Skyware, Obsidian, Lihzahrd, Steampunk, Spooky, Golden