If I had a few days in Spain after a short visit to Barcelona, I would not head to Malaga or Marbella, which to my mind are not even second-tier destinatioms (though I found Malaga a very pleasant place to spend a few of the 120 days I've spent in Spain since May 2016). A couple of nights in Barcelona is really not adequate at all. To then take the time to travel all the way to the southern coast of Spain is not, in my view, a good use of your time--which I assume is limited. There are many, many more interesting places in Spain, some of them within about an hour of Barcelona. (Start with Girona.)
Many of Barcelon's top sights require pre-purchased tickets. After deciding what you are most interested in seeing in that city, come back here with a list and we'll tell you which tickets you need to buy in advance. Barcelona's tourist load seems to be increasing significantly every year, so information about ticket strategy in guidebooks may not be totally accurate.
On a short trip you have a tough decision about the mode of travel between Barcelona and Malaga. It's roughly 6 hours via AVE train, or you can deal with airports. Marbella is a bus ride from Malaga; I'm nearly certain there are buses directly from the airport. European beaches tend to be much, much more crowded than US beaches, and they are often rocky, requiring costly rental of loungers. Be sure you know what you're getting into.
Malaga has a major airport, but I think departing from anywhere other than Barcelona or Madrid will require a connection in Europe. However, you may not have non-stop flights to your home airport from Barcelona and Madrid, anyway. Check on Google Flighrs to see what is available. Unless your cruise is a transatlantic one, you'll be looking for a multi-city flight into your cruise departure point and returning from your chosen airport in Spain.