The brackets are expanded exactly the way you'reβ used to. So we have
$$
[\frac{\partial}{\partial x}, y]=\frac{\partial}{\partial x}y-y\frac{\partial}{\partial x}
$$
where $\frac{\partial}{\partial x}$ is the operator "partial differentiation with respect to $x$", and $y$ is the operator "multiply by the function $f(x,y)=y$", and operators are applied right-to-left. In order to do calculations, it is often advisable to apply the operator to a dummy function, $g$. We get
$$
[\frac{\partial}{\partial x}, y]g=(\frac{\partial}{\partial x}y-y\frac{\partial}{\partial x})g\\
=\frac{\partial}{\partial x}(fg)-f\frac{\partial}{\partial x}g
$$
And you can now see that this results in $0$; $f$ doesn't depend on $x$, so multiplying with it before or after the partial differentiation makes no difference.
Note that one usually writes $y$ instead of $f$. That means that the letter $y$ is used both for the function and for the operator. This is unfortunate, but it's the way physicists roll.