Help! Blood when I go to the toilet

Ok so the two times I have taken a shit recently blood came out, the first time I thought I was my period but it obviously was not. Should I be worried??