From cum (“when”) (older quom) + -dam (“demonstrative ending”).
Practice speaking and memorizing "quondam" and many other words and sentences in Latin.