If you are staying in Dubrovnik and you are looking for a nice sandy beach, the place to go is the Sunj beach on Island Lopud, which is located about 7 km from Dubrovnik. You can get there with one of several daily ferry departures from Dubrovnik to Lopud, the driving time with the ferry is about 1 hour. Please note that although some of the departures are with car ferry, there is NO option to bring your car to the island, as loading and off loading cars in Lopud is not possible. When you have finished your tanning, you just grab one of the ferries from Lopud to Dubrovnik, the latest ferry back is around 8 pm.
Dubrovnik Lopud , 2023-02-09
If you are not to much into tanning, but just want to explore, you should not return to Dubrovnik once you have seen Island Lopud, but take the ferry from Lopud to Island Kolocep and spend some time on exploring that island before you return with the ferry from Kolocep to Dubrovnik. In June, Juli, August and September there are about 10 daily ferry departures from Dubrovnik to Lopud, and 4 daily departures between the two islands, Kolocep and Dubrovnik.
Alternative to arranging a trip from Dubrovnik to Lopud on your own, there is also several tours from Dubrovnik, the most popular being the 3 Island tour, the boat tour includes shorter visits to Island Lopud, Island Kolocep and Island Šipan