Why do planets go around the Sun?

The Sun’s gravity pulls planets inward while their speed keeps them swinging around instead of falling in.