Play a joke/trick on (someone)

To do a joke or trick that affects someone.

The boy played a trick on his teacher.