To make a mistake.
It's my fault. I goofed.
To engage in mischief.
We were just goofing by painting the neighbor's cat green.