Completely agree with @MrHoffman. You need to make a list of the games you want to play, then check out what their Recommended System Requirements are for both the hardware and OS.
With Mac compatible games, you have to be extremely careful since many may say compatible with macOS 10.13+, but that may be misleading since many times the information is not updated if a later OS is not compatible. For instance, many older games are only 32bit games so would not be compatible at all with macOS 10.15 which dropped support for 32 bit software. Same thing may happen for games developed for the Intel platform which may not run (or run well) on an Apple Silicon Mac, although Apple does provide Game Mode which is supposed to help, but you would want to first confirm the game(s) you want are fully compatible with an Apple Silicon Mac and even macOS 14.x Sonoma.
Also, some games with an online component to connect to other players may be restricted to just other macOS gamers since sometimes online mulitplayer between macOS & Windows is not available or can break between game updates.....especially true for any macOS games which are ported by a third party developer (usually not the developer's fault).
Macs have never really been a gaming platform. Sometimes certain games may be available and work fine, but it is usually just a handful of the popular games advertised....the exception is what is available through the Apple App Store. Games acquired from anywhere else are hit or miss. You really need to do your research for each game to make sure it is fully compatible....and the most recent version with all its updates & mods are still functional with the current version of macOS. Sometimes a game may work great at one point, but later develop issues once the developer decides to ignore the issues with the macOS version of their game.
If you want to invest money into a gaming computer, then you should invest in a dedicated Windows gaming PC instead, or a gaming console like XBox, Playstation, or Steam Deck. Even then, you will still need to do research to make sure the gaming PC meets or better yet exceeds the Recommended System Requirements for each of the games.
It is one thing to have a Mac which you use for school or work, which you end up using to play some available games which are compatible, but I would not get a Mac mainly for playing games since you will most likely be extremely disappointed & frustrated by the outcome.