The way to maximize stardust is to gain as many trainer levels as you possible can first, and then use it on pokemon that are close to maxing out anyway.
If you use it on a low level, it’ll be a waste because in a couple of levels you’re just going to find pokemon more powerful than the one you upgraded. So gaining as many levels as possible is your first priority.
That logic will always hold — it is ALWAYS better to save your stardust until you’re a higher level. But at some point you’ll bite the bullet and decide you want to upgrade some pokemon now and do some battling. In that case, look at the half circle above the pokemon. This is an ‘Upgrade Meter’, where if it’s filled all the way to the right, you can’t use any more stardust. Pokemon you catch might start out with any amount of that already filled up. So use your stardust on a pokemon that’s already mostly done for you.
See here for an example of the pokemon screen with the upgrade bar:
In that case, the pokemon is about half-way powered up. I’d hold out for one that was already about three quarters upgraded.