Thank you to @jesan90 and @Denny Glover.
My keyboard and trackpad worked at login screen, and stopped working after logging in. I tried all software fixes and gotten no result. Then I opened the back cover, took out the battery and unplugged the trackpad flex cable. I saw some ports had turned black. I wiped it with alcohol, put everything back together. Then it worked!
I was searching for how to assemble a MacBook and found this video. This guy had the same problem and did a demonstration of how to change the trackpad flex cable. In my case, I didn’t have to change the cable, simply wiping the ports with alcohol fixed the problem.
https://www.youtube.com/watch?v=BGPsUTWGqqg