The idea is to operate on a (sufficiently nice) function. In your case, "sufficiently nice" means at least twice continuously differentiable (since you will have mixed partials). Here's an example that can guide you through the computation. Suppose we want to evaluate $\left[x,\frac{d}{dx}\right]$. Derivatives don't make sense on their own. It isn't until they operate on something that they have real meaning. With this in mind, let's see what happens:
$$\left[x,\frac{d}{dx}\right]f \equiv x\frac{d}{dx}f - \frac{d}{dx}(xf).$$
By chain rule, we get that
$$\left[x,\frac{d}{dx}\right]f = xf'-xf'-f,$$
or equivalently
$$\left[x,\frac{d}{dx}\right]f = -f.$$
As an operator, we would then say that $$\left[x,\frac{d}{dx}\right] = -I,$$
where $I$ is the identity operator on whatever "sufficiently nice" space of functions you are considering. Can you see how to proceed here? Note that JEM's comment about "expanding" and "canceling" is full of potential errors. It can work sometimes but it is not guaranteed to do so. If we took his advice and applied it to the example above, we would not get the correct answer and the reason is ultimately because chain rule is lost in his approach.