Volcanoes are formed in two main ways; diverging tectonic plates and converging tectonic plates.
Divergent Tectonic Plates
Volcanoes are formed by divergent tectonic plates when the two plates pull-apart creating a rift in the earth which releases magma from the mantle. You can find examples of these at the Mid-Atlantic Ridge.
Convergent Tectonic Plates
Volcanoes are formed by divergent tectonic plates when two plates push together and form volcanoes and mountains.