There are some ways you can overcome this:
1- In object mode, select the object and go to the properties panel there you will find the tab Vertex(the image is triangle), there tou can set the Auto Smooth value where for this case i think you can set to 90 degrees. This will affect the whole object in a way that angles below 90 degrees will appear flat and above will be smooth.
2-If you don’t want to have the whole object affected, disable the auto smooth.
In edit mode, you can select the the edge loops you want to appear flat, press N to open the menu on the right(if it’s already open it will close ofc…), adjust the Mean Crease value to 1.
3- Support Edge loops. You can add edge loops (ctrl+r click and slide) near the edge you want to go flat. Create one above and one below the edge. This method gives a more natural look when applying a Subsurface Modifier.