Extremely subjective. A common answer though seems to be anything before college. Usually the teen years. Most notably high school (maybe middle school for some), which a lot of people note to be the worst time of their life. A lot of people just hate all the drama that comes with high school, as well as sitting in classes for like 7 to 8 hours every day. People usually like college way better though.
Another somewhat common answer seems to be the elderly years. Which I hear depending on the life you lead could be your most carefree peaceful years, but if you've wasted your life you have to face the fact that you know you'll be dying soon and haven't accomplished anything. Not to mention the health issues that come with being elderly in general.
A lot of people also talk about hitting a certain amount of "clarity" by the time they hit 30. That their 20s and younger were rough because they were trying to figure out who they were and their brains weren't fully developed, but now things are way better, stuff like that.
But yeah. It's all subjective. For me though, I don't know if there ever was a worst or best age to be, lol. My life has been pretty consistently shitty all the way.