If the keyboard or trackpad died on my laptop I would simply take it to be serviced. The company that made it has storefronts around the country where I can bring it in. They have an app that makes the scheduling easy.
In fact I just had the battery replaced after 5-6 years (I don’t quite remember). Works for me.