If you fool around, you behave in a silly, dangerous, or irresponsible way. They were fooling around on an Army firing range Have you been fooling around with something you shouldn't?
If someone fools around with another person, especially when one of them is married, they have a casual sexual relationship. Never fool around with the clients' wives Her husband was fooling around
If you fool around, you behave in a playful, childish, and silly way, often in order to make people laugh. In British English, you can also say you fool about. They fooled around for the camera. = mess about