The formal word I can think of is epiphany:
3 a (1) : a usually sudden manifestation or perception of the essential nature or meaning of something (2) : an intuitive grasp of reality through something (such as an event) usually simple and striking (3) : an illuminating discovery, realization, or disclosure
b : a revealing scene or moment
Definition of epiphany for English Language Learners
: a moment in which you suddenly see or understand something in a new or very clear way
It depends on the context, but usually the verb click is used, as opposed to click moment. For example, "And then it clicked! I realized why X worked." It's informal.
click verb (BECOME CLEAR)
[I] infml to be understood or become clear suddenly:
Something clicked, and I remembered where I’d seen her before.
Another informal phrase using moment is "aha moment":
Definition of aha moment
: a moment of sudden realization, inspiration, insight, recognition, or comprehension
- The aha moment you experience when you've been trying to remember the name of a song and three hours later it hits you … — Jeffrey Kluger