Beds

The bed is an item you can set your spawn to, which is very handy if your house isn't near your spawn. A bed can be crafted from 15 Wood and 5 Silk. Once a bed has been placed you can right-click it to set its location as your new spawn point.

Beds act as an NPC in terms of requirements to place, therefore you cannot place them in the wild. You have to create a hut that is liveable (side and back walls, light source, doors to enter. Table/Chairs not necessary) in order to plant a bed which makes it useful as a check for a room to see if it is viable for NPC habitat.