I recently read a post on Reddit where a Dungeon Master was asking for advice on how to get his players to stop avoiding the more challenging paths. Their players assumed their characters weren’t powerful enough to take on these particular bad guys and were trying to “grind” their character to level up.
I’ve only really experienced this once where a new player, who was used to playing video games, was transferring his experience over to tabletop roleplaying. I quickly explained that the same rules don’t apply to tabletop gaming and that in most situations the challenges are suitable for their level and if that wasn’t the case their would be plenty of clues that they should probably turn around and run as quickly as possible.

He quickly got it, but our questioning Dungeon Master has gone down that route and the party was still avoiding anything even slightly challenging.
This is where it’s useful to remind the players that there is a clock always running, the players are NOT the center of the world they are in, the day they spent killing rats in Mrs. McGregors cellar, is another day for the big bad guy to burn down another town, raise the dead to grow his army and then continue their walk towards Mrs. McGregors front door.
If your players don’t deal with the bad guy, the bad guy will eventually deal with them.
Suddenly your players are on the run, trying to escape with their lives and saving those they can. They can only try to avoid a challenge for so long before it’s breathing down their necks.