It sounds like you are running out of storage – not out of memory. You cannot upgrade internal storage in any Apple Silicon (M1, M2, M2 Pro) Mac mini. You can buy external drives – hard drives and SSDs – that you can use either for backup purposes, or to store the master copies of some of your data.
These come in various speeds, sizes, and prices.
- Mechanical hard drives are the slowest, but offer the largest capacities (up to 5 GB for portable hard drives – or around 20 TB for desktop hard drives), and the lowest cost per gigabyte. They are suitable for many files – but are not the best choice for startup drives, or for storing heavily-accessed files like a Lightroom Classic catalog.
- SSDs offer capacities up to 4 GB. The type of SSD (SATA or NVMe) and the interface which the enclosure uses (USB 3.0, USB 3.1 Gen 2, Thunderbolt 3/4, or USB4 40 Gbps) will affect speed and cost. For many applications, even slow SSDs are very fast.
- SSDs are generally silent and can be very small - an advantage for drives that you are going to leave connected much or all of the time for extra storage. They should not be left unpowered for years at a time.
Aside: If you are not already backing up your Mac mini, you should get a backup drive or drives, and start doing so. Any data stored in only one place is one catastrophe away from being lost forever.