Each NPC requires a suitable house to live in (10 blocks across and 6 high with a chair and table/workbench, background walls, door, and a suitable light source).
The Guide spawns automatically with you at the start of the game, so he will move into the first suitable house you build.
Your house can be made out of any materials, but it is most common to build your first one out of dirt and wood since they are the most abundant. You mine dirt with your Copper Pickaxe and cut down trees with your Copper Axe. Use the Dirt Blocks for walls and background and the Wood to craft the door, table/workbench and chair. A suitable light source is made from wood and Gel (dropped by slimes) to make torches, Tiki torch, a campfire, etc. You can also take down walls by using any type of hammer.