Barcelona has an excellent public transportation system that includes buses, metro, and trams. Consider buying the Barcelona Card, which provides unlimited access to public transportation and discounts on popular attractions. The approximate cost for a single ticket for the metro and bus is €2.40 and €2.20 respectively. The travel time will depend on your location; from Sagrada Familia to Barceloneta Beach, it will take approximately 30 minutes.
If you have more time, consider visiting the Gothic Quarter, wandering through the narrow medieval alleys and admiring the historic architecture, or checking out the Picasso Museum. If you have less time, you can skip the beach or Casa Batllo. Also, avoid eating at restaurants in the main tourist areas as they tend to be more expensive; instead, look for local options away from the crowds.