Weird periods, is it just irregular cycles??

So I had sex with my boyfriend 2 times last month before my period. We used a condom and pulled out (I know that’s not 100% protection). About a week before my period I had some brown/red spotting, one day was too much for a pantyliner, and it lasted like a week. I went to a doctor because I was concerned and took a pregnancy test there and it was negative. This month I get my period a week early again and it’s was heavy at first then slowed down (about as normal) and now is just like brown discharge. I haven’t had sex at all since last month after that pregnancy test at the doctors. I am stressed, I recently graduated college and have been trying to get a job and have really bad anxiety. What could cause my periods to be a little off?