Recently I saw an incredible quote that finally summed up what I felt about luck. It's from a Business Insider article, and is something that Betty Liu heard from her television coach.
"Opportunity + Preparation = Luck" (hence the blog post title, I'm so clever)
You can be in the exact right place and meet the exact right person but if you're not prepared then it's for nothing. Imagine meeting a Hollywood executive looking for his/her next big movie option, and runs into you. You don't have a screenplay written, you've just got a kind of half-formed idea. Even though you're in the right place, things probably aren't going to work out for you because you're not prepared.
Luck comes to people who work hard and put themselves into positions to luck out. You're never going to just get lucky and land a new job in a different field by sitting at home and never learning those skills you need. You're never going to just happen to sell the next Harry Potter sitting at home never writing.
You have to put in the time and effort for all the pieces to fall into place.