Why does the earth rotate?

If you search this on google you would get "because nothing is stopping it" but why is it rotating in the first place? Not even earth, like everything in general.