Costa Rica has an amazing diversity of plants and animals, including ANTS! Outside, they are fairly easy to avoid, and I have gotten used to watching out for the trails - no fun getting swarmed, or even bitten just once. But once they are inside the house, they are fair game for full-on extermination.
Of course, the first thing to do is try to keep the ants from coming in force. I can live with a few here and there, so I don't worry too much about a one-day trail in the bathroom. However, there are some species that send in "scouts," and if they are able to report back that there are ant-yummies available, then you will have waaay too many visitors! The scouts I notice are the large (almost 1/2 inch long) red or black ants that meander around the floors, usually at night. When I see them, they're squished and flushed. Usually I see one per night for perhaps 2 or 3 nights, then they give up.
There is no sense in tempting fate! Keep sweets sealed, put away food in a timely manner, and keep your counters and stove clean. You don't have to go crazy, but a quick swipe with the cleaning rag after dinner is a great way to cut down on ants (not to mention other nasties). If you use sugary sodas or coffee creamers, then it's also important to wipe the counters after using these - minute amounts go flying, and the ants will find them!
If a trail of ants becomes too much, I make a solution of half water and half vinegar (any kind will do), and wipe the trail with it. At the same time, I'll use the solution to wipe down the counters, bathroom edges, and other likely places. Usually, the ants are gone right away. But sometimes they are driven in by weather, and so it can take a few days of vinegar-wipes to completely discourage them.
About a year ago, the ants seemed to completely take over my kitchen. I couldn't even leave out a batch of cookies long enough to cool, and they swarmed over a carrot cake that was on top of the refrigerator in less than half an hour! That was the last straw! I mixed up some ant poison, and set some out. I have since had an entire year (plus!) free from ants :-) The recipe - in a small 1/4 cup jar, combine a tablespoon each of honey, water, and boric acid. Shake well. Dribble a little in the lid and leave it behind the microwave. Leave the open jar on top of the refrigerator. Check it every 6 months - it should still be a thin syrup.
PS - you can get boric acid at most pharmacies; I haven't been able to find it in grocery stores.
PPS - if you have pets, a good way to protect their food from ant invasions is to place the food bowl in the middle of a larger bowl of water, creating a moat that the ants won't (usually) cross.