Your host country is not the US, but you already know that, in fact... it's probably why you're going there. There are a lot of very fun things to learn about and prepare for before you go abroad, understanding the legal system of your host country doesn't typically fall under this category but it is necessary.
It takes a special kind of international nerd to enjoy breaking down how international law fits into your study abroad experience, luckily for you, I am that kind of nerd.
American Citizen, International Law
Being an American citizen does not make you immune to following the laws of your host country. Remember that the penalties can be much more severe than in the United States for comparable infractions. According to the U.S. Department of state, if arrested abroad, a citizen must go through the foreign legal process for being charged or indicted, prosecuted, possibly convicted and sentenced, and for any appeals process.
Open container laws
In most places in the United States it is illegal to carry and consume alcohol in public. Often this is not the case while abroad. This means that you can walk down the street with a beer, continue your pre-gaming long into your cab ride, and crack open a vodka filled watermelon on the beach without fear of repercussion. In short, its awesome, but remember that with great power comes great responsibility. Holding a drink does not make you immune to using your common sense and, in fact, could make you a target. Do your best to keep your wits about you as you explore the new found freedom of cracking open the pop-top on your beer on your walk home from the local market.
Try not to get arrested
First things first: Do your best not to break any laws while abroad. I guarantee your life will be a lot easier if you just avoid the inevitable drama associated with dealing with foreign law enforcement officers. The best way to do this is to educate yourself on the laws of your host country and to understand that while you're gone you are expected to follow said laws. If you need any more incentive DVR a couple of episodes of Banged Up Abroad (or Locked Up Abroad) on the National Geographic Channel. Yea, that should do it.
What if I get arrested?
How to handle being questioned or detained by the police varies by country (obviously) but it is very important that you understand that as a foreign national you have certain rights. First and foremost, before you confirm or deny anything, you should ask to be taken to the closest American embassy or consulate.If you cannot be taken there then demand they be called. Do not sign any paperwork, do not try and take matters into your own hands. Remain calm, follow instructions and politely insist that your consular rights be fulfilled.
Registering with the state department:
At the US Department of State they feel that a well informed traveler is a safer traveler, and I couldn't agree more. One way to stay informed and make sure you have the full force of the US government behind you if you run into any trouble while you're abroad is to register your trip with the State Department through the Smart Traveler Enrollment Program (STEP). It's a relatively simple process but it could save your life in case of a natural disaster or other emergency.