Chosen Solution

The keyboard and trackpad on my MacBook (Early 2009) stopped working. They work fine if I press the option key while booting or do anything else before booting such as reset NVRAM but once the OS boots up completely they don’t work. I also tried using external keyboard and mouse but the issue persists.

Try SMC reset and run the system through safe mode (shift key while turning on). Then try if they work and change some accessibility settings to disabled.