The Barcelona Metro is a great way to get around the city.
The best ticket to buy is the T10 which includes 10 one-way trips. It can be used on the Metro, buses, the TramVia, and FGC trains within the city zone. The T10 is also valid on buses in some of the surrounding cities. It's not valid on Rodalies trains which cover longer distances. The T10 tickets are sold from the machines in all metro stations.
As mentioned above, there are actually four train systems in Barcelona (not counting the country-wide trains): Metro, TramVia, FGC, and Rodalies.
The FGC has some extra stops where the Metro doesn't go and it also goes to some surrounding cities like Sant Cugat, Sabadell, and Terrassa and points in between. You can get on an FGC train with the T10 but if you end up outside of the City Zone then you can't exit the train station with the card. Some stations aren't attended by humans, so good luck.