HL2 crashing after trying to run compiled map

Hello, so I bought Half Life 2 to make maps for Half Life 2 and Garry’s Mod.

I made a simple test map and when I ran Half Life 2 after compiling map, it gave me black screen. Most likely a wrongly sized screen, but how I can change the resolution if it gives a black screen, I tried to press F11 to enter window mode,
but it did not work.

Also about 10 seconds later after launching it crashes/closes Half Life 2 for no reason.

The map is working fine (maybe) since it worked well in Garry’s Mod when testing.