In terms of the 24" M4 iMac, see here: iMac - Apple. Between the Technical Specifications – and playing with choosing options on the custom-order page (without actually placing an order) – you can find pretty much all configuration and pricing information that you might want to know.
A maxed-out 24" M4 iMac would have
- A plain M4 processor with 10 CPU cores and 10 GPU cores
- 32 GB of RAM
- 2 TB of internal SSD storage
- Four USB-C (USB, USB4, DisplayPort, Thunderbolt 4) ports, Gigabit Ethernet, and a headphone jack
- Support for up to two external displays (6K @ 60 Hz or less), or a single very-high-resolution external display (8K @ 60 Hz or less)
You can get the iMac with standard glass or with nano-texture glass (+$200 USD). Nano-texture glass supposedly reduces glare, but it's more delicate, and you have to use special cleaning cloths to clean it safely.
If you were looking for a higher-end processor, you could pair a M4 Pro Mac mini or a M4 Max Mac Studio with your own keyboard, mouse, and monitor. 27" 5K monitors are on the expensive side, but there are now several choices, not just the $1600 Apple one. 27" 4K monitors are cheap and plentiful – even if not as sharp as the displays on the 24" 4.5K Retina Mac, the discontinued 27" 5K Retina iMacs, or the 27" 5K Apple Studio Display.