Crime in Barcelona is pretty standard when compared to similarly-sized cities. There are areas to be cautious of, and some areas that are just plain touristy and attract pickpockets. Other areas, especially those off the beaten tourist path but still close to tourist areas, are fun to explore because tourists don’t often prioritize them.
“Las Ramblas” is the most touristy part of Barcelona, as it’s the main strip that divides the neighborhoods Gòtic (the Gothic quarter or Barri Gòtic) and Raval. Las Ramblas has some great tourist attractions, but locals say it’s not an accurate impression of what Barcelona is really like. Raval is a little dingier (you may see less-than-savory sights), but it’s not known to be especially dangerous. Gòtic is known to be the nicer side of Barcelona.
Take basic precautions like wearing a hidden money/passport pouch, not carrying excess cash, and avoiding sticking out as a tourist when possible. Using basic manners and being respectful of locals will also go a long way toward encouraging that respect in return.