One of the first few NPCs you can get to move into your town is the Merchant. He is a valuable NPC early as he will buy anything that you want to sell to him, he sells useful items, and potions, and is the only source of the piggy bank item. Getting the merchant to move in is simple and getting a town set up can allow you to start teleporting across your world through pylons.
Almost every enemy in the game will drop money so you just have to defeat enough enemies to get enough money. Getting a Vendorable NPC before the merchant is rather rare and typically requires some foresight or planning to pull off. Your path to 50 silver will most likely come from defeating enough enemies. Building a house simply requires that you have a large enough space, with a table and chair, and a light source for the NPC to live in.
Exploring underground is a quick and easy way to gather enough money for the merchant to move in. A lot of areas underground will have pots to break open and chests to loot. Pots are randomly generated anywhere underground.
Breaking them will grant different items, but you can commonly find money in these pots.
Surface level chests are brown chests found near the surface layer. These chests will contain around 10-29 silver.
Gather up enough silver and plan out where you want your merchant to live. Houses have specific conditions to follow in order to make valid housing for NPCs. Including the walls and the ceilings, the tiles inside the house must be at 60 total tiles. The dimensions for the house can be 5x12, 15x4, or anything in between. Of course it can be larger than this, but in order for it to count as valid housing it will need to be less than 750 total tiles.
The house above shows a 12 block high wall and 5 block long floor. The house below shows a 5 block high wall, and a 12 block long floor. Both are suitable for housing, but if you decide to go with the taller house, you will need to use a crafting table as the table rather than a regular table.
Fill in the space with walls, add a table and chair, and include at least one light source. If you have over 50 silver the merchant should move in by the next day. NPCs will only move in during the morning, so you may have to survive a night before you see the merchant move in. NPCs that are moved in will also lower the spawn rate of enemies while you are in the town. This is essential to keep yourself and your NPCs safe.
The merchant will sell items that are good for the early stages of the game. He will also unlock more purchasable items as you progress through the game and defeat bosses. From the beginning of the game he will sell a mining helmet, piggy bank, iron anvil, copper pickaxe and axe, torches, lesser healing potions, lesser mana potions, wooden arrows, shurikens, rope, and a sickle.
The mining helmet is more for utility than being a solid choice for armor. It will light a small area around your character so that you do not have to place or hold torches to see the area around you. Sickles will allow you to harvest grass for hay blocks. The piggy bank is a valuable item as its storage is the same across your world. Meaning you can effectively use the piggy bank as a backpack. The bug net is how you can catch critters for fishing bait, cooking into food, or placing terrariums with critters inside.
The merchant is a valuable NPC as you can use him as one of the first vendors you can encounter. He sells some exclusive items that you can only obtain through the merchant. The upgrades to these items come much later in the game so he offers the base alternatives at a very early stage in the game. His requirements are not too difficult as you only need 50 silver which can easily be obtained in one spelunking adventure.
Congratulations, you now know how to unlock one of the first NPCs in Terraria. The merchant will give you access to a vendor who allows you to sell unwanted items, sells useful consumable items early in the game, and with enough happiness, he can power a pylon. With the merchant, you are well on your way to establishing a town. Keep an eye on the happiness of your NPCs to ensure that your pylons are powered and that you receive discounts from vendors.
The merchant likes the princess, the nurse, and the golfer. Having enough NPCs nearby will power pylons. Ensuring that the merchant likes his neighbors and his neighbors like the merchant will keep your pylon network powered.
The wizard, the tax collector, and the princess love the merchant. Interestingly, the tax collector loves the merchant, but the merchant dislikes the tax collector. It can be difficult balancing where the merchant will go, but luckily not many NPCs dislike the merchant. You can easily power a pylon in the forest by placing the merchant as well as other NPCs that like the forest in a town together.
The merchant likes the forest and dislikes the desert. It is best to keep the merchant out of the desert to keep his prices lower and power a pylon in the future. Give the merchant what he wants and you will get discounts on his inventory. As many of his items are consumable and you will want stacks of these items, it is best to keep the merchant happy.