What public beaches are closest to Lucca?
The resort town of 'Viareggio' is the closest and most easily accessible from Lucca via public transportation (train or bus).
https://www.visittuscany.com/en/destinations/viareggio/
https://www.discovertuscany.com/viareggio/viareggio-an-overview.html
A close high school mate of mine, who now lives in Lucca, swears by 'Castiglioncello', another resort town just south of Livorno, and he's constantly sending me photos of himself and his family in Castiglioncello every weekend to make me feel envious. Not as close as Viareggio, but still very close and easily accessible by train (Castiglioncello is smaller and has a prettier, albeit rockier, beach, in my opinion).
https://www.visittuscany.com/en/destinations/castiglioncello/
If you are using public transportation use the train company website for schedules:
www.trenitalia.com
Enter from Lucca to Viareggio (or Castiglioncello).
Public transport or car?
Depends on how much walking you wish to do. There appear to be some nice beaches south of Viareggio, in the vicinity of Torre del Lago Puccini.
We will have both available.
That changes things! I interpreted it as a train journey, but if I had a car I'd go to more trouble to get to the nicest beach possible.
How long do you wish to drive? In an hour, you could be at Tellaro, locations of some fine though rocky beaches.
An hour to the south, you might want to check out the area near Bibbona.
There are some nature parks in the vicinity that you might want to research:
https://www.visittuscany.com/en/ideas/best-beaches-near-pisa/