Basically, crime is only a problem in San Jose and some other highly touristed areas. Crimes are mostly petty such as pick-pocketing, purse snatching, car theft and passing of counterfeit money. One of the benefits of not having a military is that Costa Rica is not a gun oriented society.
Criminal acts are normally non violent and very few criminals have guns.
There are youth gangs known as 'chopolines', which in Spanish means grasshoppers. They are young street kids who are generally found in the poorer sections of San Jose, Limon and Purtarenas. The likelihood of any of these things happening can be dramatically reduced with a linle knowledge and foresight. The number one way to prevent crime from happening to you is to realize that you stick out . You are not a Costa Rican, you do not dress like a Costa Rican, you do not act like a Costa Rican, and they know that.