How to disable the MacBook screen when connected to TV via HDMI
You can use your MacBook in clamshell mode, which disables the internal display, by closing the lid when your Mac is connected to the display (and AC power is connected). You can then use an external keyboard and mouse to use the computer.

Opening the lid restores the internal display, however you can set it so that the display stays disabled after opening using the following boot argument, then reboot once to enable the new setting:

sudo nvram boot-args="iog=0x0"


Reset using sudo nvram -d boot-args or by resetting NVRAM by booting with ⌘⌥PR.