(For those who don’t know cricket: if your opponent is outscoring you heavily, there’s no way to win the game, but by playing defensively, there still is the possibility of “not losing” the game (called a draw. That’s different from a tie, where both teams score the same number of runs. Ties are extremely rare (about 1:1000 matches. See https://en.wikipedia.org/wiki/Tied_Test), draws fairly common (about ⅓ of all test matches)). Part of the charm of test cricket is that trying harder to win a game also increases the risk of losing it, so teams have to make educated guesses as to whether to pursue that)
Not enough monetary incentive either, it doesn't pay as well as T20.
Second problem is bowling doesn't pay as well as batting. And that brings only batsmen centric view to the game, which is boring to watch after a while, even in T20.
This eventually happened in ODI's as well. It just all reduced to batsmen playing purely for records. Competition dried out.
T20 suffers from the same problems, and is a big reason why people are so burned out. I have barely watched any cricket in years.
In matches where is there is a good pitch, and something for the bowlers, the test matches are super interesting to watch.
All three formats are thriving with some superstars playing all three formats and official World Championships being played in all three formats