At the moment, the only cost-effective way to buy RAM is 2nd hand.
AI has just hoovered up nearly all RAM manufacturing capacity and this is not likely to change anytime soon - don't expect prices to come down for a couple of years, and even then it will only be relative to the ludicrously high prices for consumer-grade RAM we are currently experiencing.
SSDs are also hit by this*, and GPUs have the double whammy of high RAM prices on top of demand for AI rendering and cryptomining - the highest I've seen is £6228 for a graphics card!
* I bought a 500GB SSD in 2020 for £52 - this exact same item now costs £152