Since the MacBook's keyboard is not recognized by the macOS, you will need to use a wired USB keyboard and mouse to troubleshoot and resolve this problem. Most any USB mouse will be sufficient. And even a PC keyboard will work. Borrow these from a friend or family if need be.
If you end up using a PC keyboard, know that the Windows key will be used as the Command (⌘) key and the Alt key will substitute for the Mac's Option (⌥) key.
Start by booting the MacBook in safe mode.
Turn on or restart your Mac, then immediately press and hold the Shift key as your Mac starts up. When you see the login window, release the Shift key
If you can login to your Mac with the USB keyboard, that's a good sign.
After you have logged in, go ahead and shut down the computer normally, disconnect the keyboard and mouse and attempt another normal restart of the computer.
If you cannot properly boot in safe mode or normally with the external keyboard and mouse, then you may need to get the computer to a shop for service.
You can make a Genius Bar appointment for hardware/software service and support using this link:
Contact Apple for support and service - Apple Support
Get your Mac repaired and see how much will it cost:
Mac Repair & Service - Apple Support