Before coming to the example, one needs to understand the two types of karma in play here - Prarabdha and Kriyamana. But I will also include Sanchita karma for good order sake.
It is all your accumulated karma of past lives.
It is that portion of Sanchita karma that will fructify in this life. One cannot escape it.
The Sanskrit word for luck is अदृष्ट / Adrushta - meaning 'Not Seen'.
It's basically the consequences of your actions done long ago. If your actions were good, you'll get good luck, if not, bad luck.
If you go to work, you get salary - that is karma & phala.
But if you, say donate money to poor, ...
Who does the actions is emphasized atleast twice in Bhagavad Gita by Shri Krishna that Prakriti alone does all the actions and it happens by default. But due to the deluded false ego, the Jiva assumes itself to be doer and thus incurs consequences of Karma.
प्रकृत्यैव च कर्माणि क्रियमाणानि सर्वश: |
य: पश्यति तथात्मानमकर्तारं स पश्यति || 30||