The Rock Smash skill is activated by pressing the right trigger on your joy-con. You will then be able to either hit a blue gem or a pillar, each with their own rewards. In order to get rid of rocks in the level you must break them and they will disappear once broken.