Loot and Magic Items

Generally speaking, the loot and magic items found as treasure should be randomly generated. Generate a treasure hoard per "adventure day" worth of encounters, which should be about right for one game session (about 4-6 combat encounters).

If there is an award offered for completing the adventure, take that out of the hoard amount.

Here is the random generator I am using: https://5e.tools/lootgen.html

I would roll until there is at least one permanent magic item. The issue with this is that it only generates items from the DMG. I think it would be cool to have the occasional weird item from other sources or custom made by our DM's. If you like, you can substitute an item of the same rarity and power level that makes sense. "Power level" is kind of a hidden stat in the DMG. Items are either "Major" or "Minor." The breakdown is spelled out in Xanathar's Guide. In the DMG, the minor items are those listed on Magic Item Tables A through E, and the major items are on Magic Item Tables F through I.

The random generator above has a setting that lets you randomly roll on specific tables and rates the major/minor as well as rarity.

I would not try to customize the items to the characters. Rather, I would customize to the encounter putting in items that make sense, especially items that the NPC's can effectively use against the party.

Occasionally, encounters or adventures may center around a particular item. Maybe a character is questing for it or something like that. That's cool, too. I guess the only "rule" is: don't be cheezy.