There are two different explanations. There are Memory and Storage. Memory is what the 8GB is referring to. Memory (RAM) is the space your computer uses while running apps and computing. Storage is where the computer stores files and data. Your storage is what the 474.91 out of 494.38 is referring to.
On Apple Silicon (M2) Macs neither the memory nor the storage can be increased. The user has to live with what they purchased. Your MacBook is running out of storage since it had 512GB total to begin with. So you will need to delete some files or offload them onto an external device like a USB stick or SSD (solid state drive). Another way to manager storage is to sync files to iCloud (Apple’s cloud service)
Manage iCloud storage on Mac - Apple Support