Hi guys, a little correction here. Not all enzymes are proteins. There are RNA molecules that can now act as enzymes. So broadly speaking, enzymes are catalysts, they catalyse the reaction by lowering activation energy. They shift equilibrium to the right. Now as for the cofactors, yes they are mostly ions. Cofactors are necessary molecules for the enzymes. For example, DNA polymeraze needs MgCl2 in order to function.
Prosthetic groups, are basically nonpeptide molecules that are found in proteins. Yes for example Hemoglobin and Myoglobin have Protoporphyrin rings that are prosthetic groups that are also needed for the proteins to function. But overall they are the same, it is just smaller molecules like Mg, Cl, Copper are called cofactors, whereas larger size molecules like Protoporphyrin rings are called prosthetic groups. Yet their functions are the same.
I hope that answers your question. Good luck studying.