Q: How do you stop an astronaut’s baby from crying?
A: You rocket!
Explanation: Astronauts are scientists who explore and study space. To get into space they blast off in a rocket. In this case, ‘rocket’ is a noun, a thing.
When babies cry, they can often be calmed, soothed, by rocking them. To rock a baby means to gently move a baby back and forth, maybe by swaying, walking, or sitting in a rocking chair. To calm a baby, rock it. Here ‘rock’ is a verb, an action.
This joke is funny because rocket sounds just like “rock it.”
Here is another: Rockit by Herbie Hancock: