Is there a way to delete a shape with an extrusion
Use the inset tool (Keyboard shortcut: I)

Select the faces, inset, and use the inset individual option.

from there you can extrude.



To make a though cut, select faces on top and bottom, inset, delete the newly created faces, select the edges on top and bottom and use bridge edge loops to connect top and bottom. (bridge edge loops