In a one-shot adventure, I will typically place specific magic items that can be useful in the context of that adventure. I will also tend to "front load" them so that PCs get them early enough where they can use them by adventure's end if they wish.
In an ongoing campaign, I use random treasure tables and I ask the players to roll for it. Whatever they find, they find. In my experience, the players have a lot of fun with this because they know they have a chance to get some really great stuff. I typically use treasure as a reward for exploration challenges rather than for combat challenges (where they instead get XP).