1) If you are running anti-virus or so-called "cleaning" apps, those will affect RAM usage. Remove any such software and let your Mac be a Mac.
2) If you are using Chrome, it is a known resource hog. It and its minion "helpers" can use massive amounts of CPU cycles and RAM.
3) A simple restart is the 100% effective way to clear RAM on a Mac.
There is a way for us to quickly see if something is contributing to high RAM usage and swaps without playing a protracted game of "20 Questions"with you that could go on for days.
We can quickly and within the confines of these forums help you determine what issues are at play if you use EtreCheck Pro, available here:
https://etrecheck.com/index
The free version will do nicely for this purpose, although the app is worthy of our financial support.
We can see hard data about drive performance, software issues, and RAM usage. Etrecheck is the development of a long-serving and trusted contributor here expressly for displaying information in these forums to help us help you in this setting where we can neither see nor touch your tech gear. It will not reveal any personal or secure information.
We senior contributors here have reviews thousands of these reports over the years and may see something important in the report that will not "jump out" at a new EtreCheck user. Posting the report often leads to an issue being fully resolved with only one more post of your part.
The report is too long to post directly, but this this excellent user tip shows how to post long text reports like EtreCheck using a feature included in the forum software.
How to use the Add Text Feature When Post… - Apple Community