The stardust in Pokémon Go does not have a very clear function at the beginning, just as it is not so easy to understand how it is conquered. It's time to explain everything: here's everything you need to know about stardust!
The stardust first of all serves to enhance our pokémon, however it is not available for purchase. The only way to get hold of it is to catch other monsters, as well as for candy (another crucial item for evolutions). Unlike these, however, stardust is not only usable on specific pokémon but on all those in our possession.
Each captured pokèmon will provide us with a certain amount of powder, which however will not be too difficult to acquire. In addition to the method of capture, stardust can be obtained from gyms: by conquering them and managing to keep them, your pokèmon will provide you with various items daily, including stardust.
To use the powder and upgrade your pokémon just go to the list of those currently in your possession (click on the pokeball in the center of the screen and then on pokémon). Select the pokémon you want to upgrade and you will notice two buttons (evolve and upgrade). Near the upgrade button you will see how much powder and how many candies will be needed to upgrade your pokémon (the amount will vary from pokémon to pokémon). Obviously take well into consideration the number of candies needed to upgrade the pokèmon if you also intend to make it evolve immediately!
Other Pokémon GO guides:
Pokémon GO: Basics Guide
Pokémon GO: How Eevee evolves
Pokémon GO: How to level up quickly
Pokémon GO: How to save battery and traffic
Pokémon GO: How to get free coins
Pokémon GO: Guide to weaknesses and strengths