From the bus terminal in La Quiaca you need to find the border, which may involve you asking someone in the town. It’s a short walk down a slope and then down a long tree-lined road to a bridge. Facing the bridge you’ll see a set of buildings on the right side. You need to go there to get your exit stamp and then, a little further on but in the same complex, you’re entry stamp. The border guards appear to have just woken up from a long coma, so don’t expect efficient service. If you have to buy the visa ($135 US for Americans) you do it there. The office opens at 6am. You must have crisp dollars.
After you’ve got your stamps you walk across the bridge to be accosted by the people selling bus tickets to all Bolivia.
If you’re taking the train you need to walk up the hill beyond the main square and continue walking for a bit, keeping a sandy wall at your side. Eventually you’ll come across the station through a hole in said wall.