The
conservation of angular momentum says that when something very large rotates very slowly and shrinks to a smaller size - it will rotate faster. Think of an ice skater with their arms swinging out wide - they turn slow. When they bring their arms in close to their body they rotate faster. That's conservation of angular momentum.
Same thing happens when heavenly bodies form. A very large nebula of gas and dust may spin very, very slowly; but when it collapses it will conserve its angular momentum causing it to rotate much faster by the time it becomes a star. The process is similar for galaxy and planet formation.
There's no constant force making these things rotate. When you start something rotating in space it will continue rotating by
Newton's first law. So, the rotation you see now is what's left from the original rotation when these things formed.
~modest