Make sure the screen brightness is at maximum.
More than likely you have a hardware issue with the built-in display which will need repaired since you are able to boot the laptop and use an external display.
Make sure to disconnect all external devices from the laptop & from the external display. Of course you will still need to keep the external display connected in order to use the laptop.
Edit: I guess you can also try a DFU firmware Revive which resets the security enclave & system firmware. Theoretically this should not affect the data on the internal SSD, but not guaranteed if there is a hardware issue with the Logic Board.
Also, make sure to have a good backup now while you still can. You will want a good backup before having the laptop serviced. You should always have frequent and regular backups since there are so many new ways to permanently lose access to data on the internal SSD of the newer Macs due to all the hardware, software, and security changes.