That would be a local or state law. Not a nationwide law. It would depend on where you are. Some areas don't care, while other areas are militant about it.
Where I am is somewhere in between. Don't stand out and your generally fine.
Because it’s hard for me to imagine that anyone would say something when someone simply enjoys a nice cold beer during the hot summer in a park or something.
Yea, that's not really a thing where I'm at. Your own yard, sure, Campground, maybe. But almost nobody is staying outside let alone drinking any type of alcohol in the park when it's over 90 F (+32.2 C) outside with over 90% humidity. More likely in the spring or late fall though. Just don't stand out.
For comparison: https://weatherspark.com/countries/US/AL and https://weatherspark.com/countries/DE