There may be no easy (general) solution, but there may be an acceptable solution in a particular case.
The halting problem is unsolvable, but you usually can say with certainty that a particular piece of code is not an infinite loop. The knapsack problem may take ridiculous time to solve precisely, but moat of the time you have little trouble packing your backpack or bag so that everything you need fits. Etc.
Often you only need to solve 20% of the problem to get 80% of the benefit. Make this step, and you will face further problems from a much better position.
The halting problem is unsolvable, but you usually can say with certainty that a particular piece of code is not an infinite loop. The knapsack problem may take ridiculous time to solve precisely, but moat of the time you have little trouble packing your backpack or bag so that everything you need fits. Etc.
Often you only need to solve 20% of the problem to get 80% of the benefit. Make this step, and you will face further problems from a much better position.