Reverse psychology operates with exactly that premise. Tell someone not to do something, and they may flip in thinking and actually do it. I try to stay alert to subtle messages of not doing something so that l am not influenced. The power of the text or the graphic is used heavily by PR firms.
https://www.webmd.com/mental-health/features/reverse-psychology-work
https://www.webmd.com/mental-health/features/reverse-psychology-work