Rotation Sensor Presets

My team and I are currently trying to find a way so that when we push a button for example X it would spin the motor until it hits a specific degree on the rotational sensor stopping it.

Any help would be appreciated thank you