We present a formula which relates the Kazhdan-Lusztig polynomial of a matroid M, as defined by Elias, Proudfoot and Wakefield, to the Kazhdan-Lusztig polynomials of the matroid obtained by deleting an element, and various contractions and localizations of M. We give a number of applications of our formula to Kazhdan-Lusztig polynomials of graphic matroids, including a simple formula for the Kazhdan-Lusztig polynomial of a parallel connection graph.