The aim is to construct edge loops along the curve.

A way to do it:
Start with an open cylinder, cut it in half and mirror it. Then extrude the bottom half part.

Add a circle (or the curve shape you want) with a high resolution. Then manually snap the top part of the cylinder so that it fits the curve.

Add two vertical knife cuts: one on the right to delimitate horizontal and vertical sections, the second on its left to give more precision to the curvature. For this last one adjust its top vertex (or vertice as some say) to the curve.

Extrude all the edge except the top 3 vertices, horizontaly to the cylinder center.

Add 3 loop cuts and fill the open faces, so that the first loop is now done.

Add two loop cuts to the exterior part, like so:

Use X 'dissolve egdes' and 'dissolve vertices' and also knife cuts K to adjust the geometry.
On left here an intermediate step, final step on the right.

Adjust vertices positions mainly using GG to slide along edges.
Add a subdivision surface.

The blend file includes this construction step by step:
