Chosen Solution

Because of my inexperience, when replacing the battery, I have accidentally broken the trackpad cable under the battery because the battery is too tightly glued.

Now, I can get into the system without a battery, but I’m wondering why my keyboard does not work. Is it because the mac can’t use the keyboard because the touchpad is broken?

You’ll need to replace the damaged cable MacBook Pro 15" Retina (Late 2016-2019) Trackpad Cable to get your system working again.