Any ram with the same socket will work just like a CPU?
No! Just because RAM physically fits a slot, that does NOT mean it is compatible with that board!
Whenever you buy a new motherboard, you need to look at the motherboard's QVLs (qualified vendors lists) for compatible CPUs and RAM. You must use a listed CPU to ensure compatibility. However, there are too many RAM makers and RAM models for motherboard makers to test and certify them all. So you don't have to use listed RAM but you should use RAM with the same specs as listed RAM.
Your board's QVLs are listed
here under CPU Support and Support List.
Also, it is important to understand that a new motherboard constitutes a new computer in terms of software licensing. If your current Windows license is an OEM/System Builders license, or you "upgraded" to your current OS based on an existing OEM/System Builders license (and the vast majority of current license fall into one or both of those categories), to be legal you will need to buy a new Windows license too.
If me, I would buy all new with the latest technologies. DDR3 is old technology RAM, for example.
If your current system did not used to be
"slow, laggy, and freezing" and you are not ready to upgrade the RAM and CPU as well as the motherboard and Windows, it might be better to try and sort out the problems you currently are having - especially since the cause of your
"slow, laggy, and freezing" performance may not be your motherboard.
And FTR, I also have been using Gigabyte boards for years. They are my preferred brand.