Nothing spoils a beach day faster than the meltdown at the end (well, maybe sand in your lunch). Here's a trick that worked with my 4-year-old last summer.
Start with a warning. Around 20 minutes before you plan to leave, mention it casually: "Hey, we’ll be packing up soon. Do you want to make one last sandcastle or jump in the waves?" This gives them a choice, meaning that they feel more in control. I've tried the "ten minutes left" announcement... big mistake. It sounds more like an alarm than a heads-up.
When the time comes, offer a simple choice: "Do you want to walk back holding the beach ball or wearing your hat?" By focusing on something specific and familiar, you're gearing their brain to agree, rather than resist. (I've had to remind myself to phrase it this way more times than I care to admit.)
Now, here's where it occasionally gets tricky. Kids may resist — perhaps they're just overwhelmed by a day of excitement and sunshine. Usually, they're yearning for a bit of predictability amidst the chaos of packing up and leaving. Sometimes they just need a moment.
When my son exclaimed, "I don't want to leave!" and started his dramatic flop, I simply sat next to him and started packing. I didn't ignore his feelings; I acknowledged them by saying, "It's tough to leave when we're having fun." Then, I paused. (Ten seconds is longer than you think.) Once he calmed a bit, the choice question came back into play, and we managed to leave with minimal fuss.
If you're regularly facing afternoon meltdowns at the beach, consider if there could be an underlying need not being met. It might be worth consulting a pediatrician if these struggles become a regular pattern or start to affect other parts of daily life like eating or sleeping.
This won't solve everything. Some days, you'll still face sand-covered, salty-teared tantrums. But that's parenting, right? You could say it's like building a sandcastle — you learn to embrace, well, the sand part.