A standard compartment in Sleeper, 3AC, or 3E coaches is built around six main berths plus two side berths, repeated in blocks along the coach. Here's what each railway berth looks like in practice.
The lower berth sits at ground level, right by the window, and is the easiest berth to access, no climbing involved. It doubles as a communal seat during the day, since passengers from the middle and upper berths typically sit here until the coach transitions to sleeping mode. It's also the berth automatically prioritised for senior citizens, pregnant women, and passengers with disabilities under Indian Railways' reservation policy
The middle berth folds down from a stowed position between the lower and upper berths and is meant strictly for sleeping. During the day, it stays folded up so the lower berth can be used as seating. At night, it comes down and effectively separates the lower and upper berth occupants. It offers the least flexibility of the main berths, since it can't be used for sitting.
The upper berth sits at the top of the compartment and stays out of the daytime seating arrangement altogether. This is exactly why some passengers prefer it, nobody needs to disturb you to sit down during the day. The trade-off is the climb up and down, along with a bit less headroom.
Running along the aisle rather than in the main compartment, the side lower berth converts between a daytime seat and a nighttime berth. It comes with its own window, which makes it a popular pick for anyone who wants to watch the passing scenery.
It is positioned directly above the side lower berth. The side upper offers a similar setup to the regular upper berth but with a bit more room to sit up, since it isn't boxed in on both sides.
Not every coach has this one. The side middle berth appears mainly in higher-capacity or economy-class layouts, fitted in between the side lower and side upper. Where it exists, it's a foldable, night-use-only berth, similar in purpose to the regular middle berth.