screw around

Upper Intermediate (B2) informal

To waste time being silly or irresponsible, or to be unfaithful to a partner.

"The teacher told the class to stop screwing around and open their textbooks."