Cutting a rectangle from an arc
The basic key to a good subdivision surface result is having a loop of faces along either side of any edge that you want to harden. In your case, you have supporting edge loops on the extruded sides of your arch, but not on the large flat surfaces:

I used the bevel tool with the following settings to create face loops around each of the edges that needed to be hardened. This could also be done with the bevel modifier, using either angle or bevel weight as the control.

Here is the result with subdivision. Note that because the top and bottom are completely flat, and surrounded by face loops of quads, it doesn't matter that much that the geometry as a mess, as long as none of the n-gons are too concave. They can even be made all tris: