How do I give the right amount of treasure without going overboard, like my last DM did?

I am trying to find a good model for how much treasure and money to give my players in order not to make items too difficult to buy, or too cheap to buy.

In my last game, which ran for 6 months, our DM ended up so freely giving us gold that everything was trivial for us. Our characters at level 6 were so rich, we could afford any comfort and travel as kings. This was not because we found a treasure hoard, but because our DM had accidentally been giving us too much treasure for our encounters.

For example, every time we would fight something, they would reward us with 1-2 Platinum, sometimes more. They also used in-game currency for out of game creativity. If you made them laugh, you got another Platinum or like 100 Gold.

Nearing the end of the campaign, everything was so cheap that it wasn’t fun anymore to even buy anything or save up for fancy lodgings. We could afford hundreds of potions, countless trips to the local temple, resurrections…etc. There was no threat of dying, no challenge in earning, and the game lost steam fast.

I am not good with math. I am nowhere near an economist, but when I run my campaign I don’t want to end up with the same problem.

Are there any charts or rules of thumb for making a balanced, long-term economy in D&D 5th?

How do I assign treasure in a way that doesn’t inflate to worthlessness down the line?

I am looking for charts, guides or tables ideally. I would really appreciate the help.