Liquidity providers cannot avoid impermanent loss completely. However, they can use some measures to mitigate this risk such as using stablecoin pairs and avoiding volatile pairs.
One strategy to avoid temporary loss is to choose stablecoin pairs that offer the best bet against IL since their value does not move much; they also have fewer arbitrage opportunities, lowering the risks. Liquidity providers using stablecoin pairs, on the other hand, are unable to gain from the bullish crypto market.