Volcanoes work by allowing molten rock (magma) from beneath the Earth's surface to erupt through a vent, creating various landforms like mountains, plateaus, and islands. Their role in shaping landscapes is significant as they deposit layers of volcanic ash, lava, and rock, which can form new landmasses, alter existing topography, and contribute to the formation of fertile soils. Additionally, volcanic activity can trigger processes like erosion and sedimentation, further influencing the shape of landscapes over time.