Dream that I cheated

In my mind I wasn't going to tell my partner I had cheated,his friend messaged me asking saying his mate (the guy I cheated with) had told him and was I going to tell my partner? I woke up and questioned if I had recently slept with someone who wasn't my partner! Really scared me and my head went really weird upon waking, I honestly don't think it was real but it was so convincing but I'd never do that! Why is my brain doing it to me?