How much free disk space do you have? What year is your Mac, you are running MacOS 10.15, correct?
Several things you can try:
Before doing anything, make a complete backup of everything and check to make sure it works, e.g. you can restore a few files or folders that you use to test the backup.
(1) Boot into Safe Mode, this is standard troubleshooting, hold Shift key down when starting up after first shutting down the computer completely. This boot will take much longer than normal, be patient, keep holding Shift until a login screen appears. It should indicate "Safe Boot" in red text. Try running Firefox and Pages while under Safe Boot, which may run fairly slowly as some optimizers and accelerators are off. Do they work now? Then restart normally and retest.
(2) If there are still problems, try creating a new user and log in to that user and test Firefox and Pages. Do they work under a different user?
(3) If computer is still not behaving, download and run Etrecheck with full access granted, this is a safe program that is also a standard troubleshooting tool. Please post the output here using the button below for "Additional text." The output includes no personal or identifying info, but it provides information about the health of your system and what is installed. Sometimes something installed will cause conflicts on the computer. People will look for those when you post the output here.
If neither (1) nor (2) nor (3) provide any relief, the next steps would be to reinstall the MacOS, which normally does not require erasing the disk but it is important to have a good backup before embarking on that. Hopefully this will not be necessary.
P.S. Just noted that someone else posted while I was typing with similar suggestions!