Take the law into one’s own hands

To attempt to administer the law oneself.

The citizens took the law into their own hands when they arrested the man who had cut down the tree.