This is a well-known Hammer problem, and it is usually fixed by refreshing the SDK content.
Start by clicking Refresh SDK Content. If the 2D and 3D views still render as black shapes with no grid, choose Reset Game Configurations next — a corrupted game configuration is the most common root cause.
As a last resort, change the engine version or the selected game in the Source SDK launcher. That forces Hammer to rebuild its asset references from scratch.
Hammer depends on the SDK's material and resource files being present and correctly registered. When an update lands or an installation is interrupted, those references break and the editor loses the data it needs to draw anything properly.
One of the three steps above resolves it in the large majority of cases.