Beds, cots, straw mats and hammocks are most likely to be found in houses or guildhalls, although they can also be found in the wilderness.
When you have a premium account, you can sleep in beds, cots, straw mats and hammocks that are located inside a house or guildhall, by simply "using" the bed. Doing that, your character will be logged off. If you have eaten something before going asleep, your character will regain hp/mp while offline. Also, your character will regain Soul Points no matter if you have eaten or not.
Note: not all houses have beds on them. Before renting one, make sure you check if that house has any beds.
If you are a free account player, you can still have access to house/guildhall beds by being invited in the respective house, but you cannot sleep on them.
Also beds you see in the "field" can not be used to sleep on.