Yeah, good luck with that....it is not easy to do on the more recent Macs. Sometimes it may even be impossible.
Do you have the Intel Mac or Apple Silicon Mac?
Also, what version of macOS?
You can try toggling Display Mirroring on/off by using Command + F1, or Command + brightness down. If you have the Touchbar model, then you may need to first hold the "FN" key followed by those other mentioned keys. However, many times macOS won't toggle display mirroring until after successfully logging into macOS.
You can try logging in blindly. If you are running macOS 14.x Sonoma, just type your password (assuming you are the only user account, otherwise use the password for the last accessed user account). If running any other version of macOS, then type the first character of the user account name followed by pressing the "Return" key. This will give you the password prompt for that user account (if you have multiple users beginning with the same character, then I have no idea which one will be selected). Press the "Return" key to submit the password. I'm assuming you have a list of users normally. This also assumes you just booted the Mac and are not attempting to log in from the lock screen. Adjust accordingly, or maybe force the laptop to power off by holding the power button until the laptop fully powers off. Then power it on so it gives you a standard login screen.
You can try putting the laptop into Clamshell mode. Connect the power adapter, external display, and a wired USB keyboard & mouse. Close the lid of the laptop to see if it will trigger the login screen to be shown on the external display.
If you have macOS configured to have Display settings icon on the menu bar, then maybe you can access those settings on the extended display screen.
Even if you can log in blindly, there are some situations where you may still not be able to get anything useful on the extended display because macOS may be stuck on a configuration prompt window (can happen after an OS update patch).
You can try looking very closely at the built-in display in case just the backlight is out....you may see a very faint image which you can attempt to navigate. Best to do this in a dark room. May need to shine a light on the laptop's display as well. This won't be easy either.
You can also try closing the lid and very slowly & carefully opening it just a crack. Do you see the display come on? If so, maybe you can open it just enough to see to navigate to unlock it (usually less the 45 degrees).
You may just need to get the laptop repaired.