You may want to try running the Apple Diagnostics to see if any hardware issues are detected.
Does the built-in Keyboard work once you log in? If both the built-in Keyboard & Trackpad fail at the same time it usually indicates a problem with the Trackpad Flex Cable which has a high rate of failure on the 2015 model. However, the problem could also be a bad Trackpad or a bad Logic Board.
If only the built-in Trackpad is not working, then you should try creating & using a new user account which will have new default preferences for the Trackpad. If the Trackpad works while logged into the new user account, then you may just need to delete the Trackpad .plist preference file in the main user account. If a new user account has the same issue, then I suggest performing a clean install of macOS in order to eliminate any software issues. A clean install requires erasing the drive before installing macOS to it. You can install to an external drive if you don't want to disrupt your internal drive. Just do not migrate, or restore from a backup, nor install any third party apps until you confirm the Trackpad is working normally.
If a clean install does not solve the problem, then you have a hardware issue of some sort so you will need to have Apple or an Apple Authorized Service Provider examine the laptop to provide you with a repair estimate.
Sometimes a swollen battery will cause a Trackpad to fail or misbehave. If you notice the Trackpad is being pushed up slightly, or the Bottom Case is starting to separate from the rest of the laptop, or the laptop is not sitting flat on a table top, then the Battery may be swollen. If the battery is swelling you need to unplug the charger and power off the laptop right away.
Edit: You may want to test the laptop with a clean install of an older version of macOS to eliminate a Monterey issue. You will need to create a bootable macOS USB installer using the instructions in this Apple article:
How to create a bootable installer for macOS - Apple Support
You can try booting into Internet Recovery Mode using Command + Option + Shift + R to access the online OS installer for the OS which originally shipped with your laptop, but this option does not always work since it requires a good network & Internet connection.
FYI, It is always best to wait at least a couple of months after a new OS is released before even thinking about upgrading to the new OS. Most new operating systems are unfortunately released with multiple bugs plus many third party apps may take a few months before the developers of the third party apps release a version of their app that is compatible with the new OS.