If you tell someone not to mess with a person or thing, you are warning them not to get involved with that person or thing.
You are messing with people's religion and they don't like that. [VERB PARTICLE noun]
Do you know who you're messing with–do you know who I am? [VERB PARTICLE noun]