I feel like I just dodged a bullet. As far as idioms go, that one is pretty easy. According to the urban dictionary it means it means, "to get yourself out of a sticky situation. A close call... or successfully avoided a serious situation". In my experience there is also a major element of luck or divine intervention (depending on your spiritual point of view). The dodging of said bullet is often followed by an intense feeling of bliss and gratitude, not only for the second chance but for all the good things I might have previously taken for granted.
I don't know where the term originated, but in literature there is one author who literally dodged a bullet. In 1849, Fyodor Dostoyevsky was sentenced to death for being part of a liberal group of intellectuals. He was led before a firing squad, but at the last second his sentence was commuted to just 4 years of hard labor. At that point he had only written one novel. The world would never have read Crime and Punishment or any of his other great works. Who knows how our world might be different today.
I read Crime and Punishment when I was just out of high school, but before college. Something in that book changed me. I read everything I could by him and many of the other classics or Russian literature (I especially loved Turgenev and Gogol). Something in the darkness and melodrama spoke to me. I had loathed my literature classes during high school. But in college I went on to major in English and chose a career that keeps me close to books.
Having dodged a bullet myself recently, I am feeling grateful for both where my life has brought me, and for what the future holds. There is magic in the library. I see it in my son's eyes when I ask him if he wants to go, and I feel it when I am away for more than a few days.