This is because the library or the ‘Other’ section contains some critical files and folders that are necessary for the proper functioning of the Mac, and if you accidentally delete one of these files, it can cause the Mac to misbehave.
Now, as always, there are some third-party apps that assist in clearing their memory on the Mac, and we recommend that you do a prior background check on these apps before using them on your Mac.