First thing I would recommend is look at GPU because it dictates your PC price and usage. I have a RTX 3090 because it's the cheapest NVIDIA GPU that will give me 24 VRAM and I specifically need that VRAM for machine learning. It's very specific and niche.
After GPU, you can look at CPU, be aware of CPU GPU bottleneck and you are good to go. Just buy the cheapest one that doesn't bottleneck too much.
RAM is very important. Ideally the more the better. I have 64 GB of RAM because of machine learning but I think 32 GB RAM is also okay.
Storage is a little less important but I prefer to have a huge C Drive. Usually 500 GB isn't enough for me. 1 TB is about right, so I have 2 TB for extra comfort.
Don't cheap out on power supply, that's the general rule for PC building.
Other than these, you can cheap out on the rest. I highly recommend look at Facebook Market for good deal. They are usually very sketchy but also very good deal.