[noun] + に気がつく [verb (plain)] + こと / の + に気がつく [i-adj] + こと / の + に気がつく [na-adj] + な + こと / の + に気がつく
に気がつく means "to notice" or "to realize": something you had not seen or understood comes to your attention. The thing you notice takes に. A noun goes straight before it; a whole clause in the plain form takes こと or の first.
The thing noticed never takes を, even though English makes it an object.
気がついた is the moment of noticing. 気がついている is the state after it: you have noticed and are now aware. English says "I realize" or "I know" for the second, so don't read it as "I am noticing".
These go beyond noticing a thing or a fact.
With よく and no object, it describes someone attentive, who notices what other people need.
Without an object, 気がつく also means to come round after fainting or sleeping. きがつく気がつくと at the start of a sentence means "the next thing I knew".