You can use boolean for this if you want to, but if you need to fill some frame-like thing with something like glass or anything similar, you can also just do only that - fill it. If you have tidy geometry around something that forms a face or edge loop, it's convenient to select that geometry with loop selection tools or insert another edge loop, duplicate it, then separate and fill the new object. You can then extrude resulting plane or use solidify modifier to give it thickness.
What I do here:
Select the object and enter edit mode( Tab )
Insert new edge loop ( Ctrl + R )
Separate it from the object using Separate menu and choosing Selection from it( P -> S )
Exit edit mode, select the new separated object consisting of only the edge loop, enter edit mode of it(Tab )
It still has all edges selected in edit mode, so I only need to fill it(F )
Then I extrude it (E) and move it up
I hit Numpad / to isolate selection in the viewport to be able to see it without any other objects so it's fully visible.
I would normally use bevel modifier for most things to have those bevels that give you highlights on object edges in reality and I would also bevel the newly crated loop and then extrude it inwards to form a groove for the glass, only then make the glass and move the glass edge inwards a tiny bit to prevent z-fighting(around 0.1mm maybe on glasses), because it's transparent and the groove may be visible in some cases through the glass, or at least some effects might be visible in internal reflections and refractions.
I mean something is definitely going on there at the edge.