During a player's turn they may choose to visit the village. The steps they then follow are performed as follows (From the Official Rules Version 1.4)
Visit the Village
1. Reveal your hand.
2. You may use any Village Effects on your revealed cards. These Effects may produce more gold, allow you to draw more cards, and so on. You can use some, none, or all of the Effects on a card in any order you choose, making sure not to use Effects from destroyed cards. No Effect on a card can ever be used more than once. Effects and gold production are cumulative.
3. You now produce gold by adding the gold value of all revealed cards still in play to any gold you produced in Step 2.
4. You may purchase one card from the Village — this includes Basic, Hero, or Village cards — from the top of any stack in the Village. The Purchase Cost must be less than or equal to your total gold value. Always place purchased cards on your discard pile. Any unused gold is lost. If an Effect allows you to purchase more cards, the total Purchase Cost must be less than or equal to your gold.
5. Finally, you level up any or all of the Hero cards in your hand, using Experience Points you have collected.
6. End your turn by discarding all cards (whether used or not) face up on your discard pile, and draw six new cards to form a new hand.
Note: Actions must be taken in order, so a card may be discarded or destroyed before producing gold. For instance, if the Pawnbroker destroys a card with a gold value, you do not gain the gold value of the destroyed card.