DeFi and Yield Farming are getting popular each and every day as investor are depositing their tokens into liquidity pools so that they can get as many tokens as they can. There is what called impermanent loss and most investors do not pay attention to this as maybe they might not be sure what it is or maybe they doesn't know it exists.
How Risky is it?
Well there are high risks involved in providing liquidity pools aas you can make losses instead of profits and you will realize it was better to hold your tokens in your wallet than depositing them in liquidity pools.
Lets say you deposited DAI/ETH in Harvest finance and 1 ETH is valued at $1000 the ETH appreciates in value and now valued at $1.100 and that difference is called impermanent loss. If you decide to withdraw your funds then that impermanent loss will become a permanent loss.
How to avoid impermanent loss?
The only way to avoid this is by providing liquidity inform of stable coins which do not fluctuate and they always remain stable. There are also other yield farm which have no impermanent loss e.g Venus.
Proper assessment has to be done and make sure the DeFi you are getting into has no impermanent loss or less so that you will not regret ever depositing you tokens in the liquidity pools. The idea is to make money not to lose money.