How do I open up a window I have closed in blender?
In the top left of any viewport window you'll find this button:

You can turn any window into any other type of window from here, and completely customize your workspace.

In your case, you were in the 3d viewport, but you were in either rendered mode or material preview, and now you're in solid mode.  You can switch between these by pressing Z while your mouse cursor is inside the viewport, or using these buttons in the top right.

Last, if you don't know what you just closed, you can create a new workspace of the type you were working in, here.

You can delete the old workspace and move on like nothing happened.