There likely a number of things at issue with your Mac. But there are some simple, mostly free, things you can do to address them.
First, make sure you’re running at least the latest version of the Ventura MacOS (Sonoma MacOS is newer, so you could run that if you like).
Caveat: Frequently, major MacOS versions require applications that have been updated to work with them, which leads to the next point.
Second, make sure you’re running the latest versions of your applications. Check each for an update and install all that have one.
Third, restart your Mac. A restart will clear caches and other system junk that’s accumulated over time the machine’s been up and running. Sleeping doesn’t count as it doesn’t provide the benefits of a restart.
Lastly, there’s an application that works literal wonders at keeping Macs running lean, mean and rock steady. It’s called CleanMyMac and it’s developed by a company called MacPaw. It is not free but it is indispensable for any Mac owner. I’ve been using it forever. It clears ALL caches, optimizes your internal drive, frees up memory that software naturally hoards for itself, maintains your machine at peak performance, safely and completely deletes any application you choose without leaving orphan files and other crap behind, and tons of other things most Mac owners don’t even suspect their machines need. Honestly, Apple should have bought CleanMyMac decades ago. It is that necessary and that good.
Once you’ve done all of the above, and keep up a cadence of periodic maintenance, your Mac will keep humming.
I have been running Macs since the first one came out, and I currently run an M1 Mac Studio, an M2 MacBook Pro, and an Intel iMac.