adverb
modifies a verb, adjective, or another adverb to indicate a sudden or unexpected event
preposition
shows the relationship between 'all' and 'sudden', indicating that the sudden event involves everything mentioned
-
All of a sudden, the stock market crashed, causing panic among investors.
-
I was just sitting there minding my own business when all of a sudden, she showed up out of nowhere.
-
I was chilling at the park when all of a sudden, my ex walked by with their new boo.
-
The peaceful atmosphere was shattered when, all of a sudden, a loud explosion echoed through the valley.