I have the following sets of edges and vertices. I'm trying to create a face out of the outer square, while leaving the 2 inner rectangles without a face. If I press F, I'm getting a double face that is overlapping the square and the rectangles.
The easiest way is to select all vertices and press F then press Ctrl+F to bring up Face Menu and select Intersect (Boolean) with Self Intersection and Union selected. Then delete the 2 faces to get back those holes. To be on the safe side I usually do M > Merge By Distance just in case there were duplicate vertices.
Go into edit mode, choose vertex edit, and select all 6 bottom vertices and press
F. Same for the top. Then connect the left, center, and right.
There is no 'quick' way of doing this since Blender has no way to know what you imagine to be holes and what parts you want to be faces.