It is our skill that gets us to positions of being lucky.
Mathematically speaking, luck a.k.a. short term variance balances out in the long run (meaning everyone has the same level of luck in the long run).
So if you have a bigger skill edge vs your opponents, you will win more in the long run.
For cash games: You can win bigger vs fish so that when you get bad beats you are still profiting.
For Tourneys: You can use correct tactics and adaptation to reach more final tables, and increase your ROI, etc.
The key to successfully overcome poker's swings is bankroll management and the discipline to follow it with a cool stature even when things don't go your way for a longer while.
But do make sure you are not playing bad if you are on a longer losing streak.