People who travel and stay away from home for more than a day need lodging mainly for sleeping. Other purposes are safety, shelter from cold and rain, having a place to store luggage and being able to take a shower.
They do that in a hotel, hostel or hostal, a private home (commercially, i.e. a bed and breakfast or guest house place, or non-commercially, with members of hospitality services or in the home of friends), in a tent, caravan/camper (often on a campsite). In addition, there are make-shift solutions.
Sleeping is typically done lying in a bed, or more generally on a soft surface, such as also an air mattress, a couch, etc. Some trains have sleeping cars.
Sometimes people sleep sitting, because lying is not possible, e.g. in a train (if not in a sleeping car), a bus, a seat in a waiting room, a bench on the street or in a park, etc. Inclinable seats allow something between sitting and lying. Whether lying on a row of seats is possible and comfortable depends e.g. on the presence of arm rests, and whether they can be moved up. In some public places lying would be possible but is not permitted.