For the first part of the answer, we work in a set theory (for instance, ZFC).
Let’s suppose I make an informal statement about sets and prove it. What is “actually” happening from a formal perspective?
Formally, there is a sentence $\phi$ in the language of set theory, and I have constructed a derivation $\text{ZFC} \vdash \phi$.
For example, let’s consider the following informal statement: For all sets a, b, c, if $a$ is an element of $b$ and $b$ is a subset of $c$, then $a$ is an element of $c$.
We translate this into the formal statement $\forall a \forall b \forall c (a \in b \land \forall d (d \in b \to d \in c) \to a \in c)$. We can then prove this statement and translate our informal proof into a formal proof using the laws of logic and the axioms of ZFC.
However, when we are discussing classes informally and prove a theorem involving classes, we typically are actually proving a “metatheorem” about ZFC. This often means we are showing how to prove infinitely many related statements in ZFC.
For example, consider the following statement: For all classes $A$ and sets $a$, if $A$ is a subclass of $a$, then $A$ is a set.
If we were working in a theory which allowed quantification over classes, we could write this formally as $\forall A \forall a (A \subseteq a \to isSet(A))$ (perhaps rewriting to get rid of notions like $\subseteq$, but you get the gist). However, when working with ZFC, we are actually trying to show the following:
For all propositions $\phi(w_1, \ldots, w_n, x)$ in the language of set theory, we can prove in ZFC that $\forall w_1 \cdots \forall w_n \forall a (\forall x (\phi(w_1, \ldots, w_n, x) \to x \in a) \to \exists b \forall x (x \in b \iff \phi(w_1, \ldots, w_n, x)))$.
So in a sense, we informally discuss classes $A$, we are formally discussing the “syntactic object” $\phi(w_1, \ldots, w_n)$ and what ZFC can prove about it.
Typically, when one is dealing with any sort of complicated statement about classes that does more than simply universally quantifying over them, it is better to approach the problem in NBG, a theory where classes can be treated directly, than to try to puzzle out the precise metatheoretic meaning in ZFC.