if you can't be good, be careful
used to tell someone to enjoy themselves at an event or during an activity, but not to take risks
As children, we were always being told to behave, or sometimes just to be good. As adults, however, those admonishments changed to “Don’t do anything I wouldn’t do!” or, perhaps, to “If you can’t be good, be careful.” It might be preferred that you just be good—not engage in risky or immoral behavior while you’re out having fun—but if you just have to be bad, be sensible about it, or at least keep it from coming to the attention of the authorities.
The saying was first published in this form in 1903, when Arthur M. Binstead said in his Pitcher in Paradise, “Always bear in mind what the country mother said to her daughter who was coming up to town to be apprenticed to the Bond Street millinery, ‘For heaven’s sake be good; but if you can’t be good, be careful’.” However, the meaning behind the expression is a lot older than that. It comes from the 11th century Latin proverb Si non caste, tamen caute, which translates as “if not chastely, nevertheless cautiously.”
There are many variations on this saying, several along the lines of “Be good. And if you can’t be good, be careful. And if you can’t be careful, name it after me.” Given those additions, you have a hierarchy of behavior to work with!