First things first, are there any other controls (mouse, keyboard) connected to your Mac? If so, check this: open System Preferences > Accessibility > Pointer Control > uncheck the "Ignore built-in trackpad when mouse...".
If that's all good, I'd suggest simply restarting your Mac in
Safe mode first. macOS will do some of its magic, perhaps it'll help. (keep in mind, that all those steps apply to pre-M1 Apple computers)
The next thing to try is resetting SMC controller. The process differs drastically for different Mac models, so read the
article carefully.
If nothing changed, try
Apple Diagnostics to determine any hardware issues.
We'll take it from there then.