If you put a battery in a socket adjacent to a drill, then drive the worm over to the rocks (so that the drill is beside the rocks), it should mine it!
Thank you so much for trying the game! Definitely a bit of DUNE inspiration with the worm!