I would appreciate clarification on what a class does

I know that a class is a template to create objects, but isn’t a class also where you generally write code too? this concept has been driving me crazy for the last couple of days and I just can’t get my head around it. Can anyone help?

(Edit : I don’t know if this makes any sense, please tell me if I’m being imbecilic.)
(Edit 2.0, my name is Blog? ehhh)

You can have code in a class, but we often have plenty of code outside of classes in many programming languages. (Java is an exception - everything in Java is must be in a class or similar structure.)

Ok thanks! I recently stopped using Java because I found better job opportunities in C# so I was all jumbled up. Thanks for clarifying this topic for me!