This has turned out really realy really long, apologies ;-;
To break it down, AM4 is the "socket", essentially the hole on the motherboard your CPU sits into.
This is what dicates which CPUs you can use a motherboard with.
Intel uses a new one (*1) every CPU generation (roughly year), so my 2016 "LGA1151" socketed motherboard cannot fit anything newer than a 6th generation intel CPU.
AMD however is a lot more upgrade friendly, they released the AM4 socket in 2016 and are still making new CPUs that fit it eight years later (although there can still be some issues with putting super new CPUs in 2016 board, it's not wholey perfect).
Theoretically you would be able to to spend a little more on a nicer motherboard with an AM4 scoket and cheap out on your CPU with an eye to get a nicer one when time & money permits.
As for trying to keep the RAM, I think the highest year you will be able to still find DDR3 RAM support is unfortunately going to be 2015 (5th Gen Intel) or whatever the latest AM3 CPUs are. (*2)
Lastly, on your current motherboard the colours indicate what "channels" your RAM is in. By putting them on the same channel, you get a bit faster performance due to computer wizardry. You'll have to look up the manual for your motherboard to figure out if they need to be in the same colour, or the alternating colours next to each other to get this benefit.
*1 Intel sometimes reuses the socket, but it's incompatible between generations. This is highly confusing for no good reason.
*2 DDR4 RAM has thankfully came down in price a lot, so limiting yourself to these older CPUs may not be worth the convinience in not having to replace that too.
I like [Userbenchmark.com] (https://cpu.userbenchmark.com/Intel-Core-i7-3770/Rating/1979) for comparing CPUs as it breaks it down into a fairly simple "this CPU is 20% cooler than this other CPU at computer" (*3), which can be useful for considering what is actually worthwile cause I don't know how to interpret the GHz or etc.
This site isn't so useful for finding a CPU, but if you were looking to buy one used, it'd let you know how much of an improvement you're getting for the price.
*3 (that's right, I put a an addendum in my addendums, I'm so sorry)
For most games the single core performance is going to be the most important stat, as very few games can use more than a single core