I'll also provide an answer that involves some thermo.
Let's utilize the Equipartition Theorem. This theorem says that the total energy of a system is shared equally between each degree of freedom such that each degree of freedom contributes a term of 1/2 kT. As a heuristic, think of a degree of freedom as a rotation or translation that produces a transformation such that you would be able to tell that the transformation creates a different image than the initial state. Let's analyze the famous KE = 3/2 kT. A monatomic gas can move in a translational manner in three independent dimensions (x, y, z). Thus, each dimension can represent a degree of freedom. Utilizing the Equipartition Theorem, we can say that each dimension contributes a term of 1/2 kT. We have no rotational degrees of freedom because if we rotate a single atom in any dimension, we wouldn't be able to see a different image after the transformation. Note that is for one molecule. We can actually generalize the total energy to U = 3/2 nRT for n number of moles or U = 3/2 nKT for n number of molecules.
Now, suppose we had a linear molecule (like CO2) or diatomic gas. In this case, you can translate the molecule in three independent dimensions. We get a contribution of 3/2 kT from this translational freedom. However, we can also rotate this molecule around the y -axis (like a merry-go-around). That's another 1/2 kT because it's another degree of freedom. You can also rotate the molecule around the z-axis (like a ferris wheel). That's another 1/2 kT. Thus, we can say that the total energy is equal to 5/2 kT. We can generalize this to any number of moles like above.
In reality though, the Equipartition Theorem is a statistical approach because it uses an average and equal amount of energy for each degree of freedom. If you ever take quantum chemistry, you'll learn that this isn't always true (such as at low temperatures), but it serves as a great model.
The important distinction from this equation (Internal Energy = Average Kinetic Energy = Total Energy = 3/2 kT) and the ideal gas law is that the conditions imposed by an ideal gas and classical mechanics can give us a mathematically different equation without the "3" or "3/2" term for the ideal gas, whereas the KE = 3/2 kt is almost purely a statistical approach.
The Wikipedia article for the Equipartition Theorem is a good read. There's also a nice derivation of the ideal gas law using multivariable calculus and Hamiltonian mechanics if you're familiar with those topics.