@Ali Nigga I have completely reset my modem. Nothing changed.
I have this issue as well.
I have tried absolutely everything suggesting: Restarted internet, reset internet, restarted computer, uninstalled/reinstalled minecraft, adjusted modem setting to allow Minecraft through, adjusted Firewall settings to allow Minecraft through, disabled firewall, EVERYTHING. Nothing has fixed this issue. It has got to be on Mojang's end, or another solution not yet found.
I've found a solution for me.
For some reason, MalwareBytes anti-malware was blocking my connection to the server WITHOUT TELLING ME. Nothing on Windows Defender, nothing on my Modem settings- this one, single, program.
Here's what you need to do to check if something is blocking the server connection (at least, what worked for me):
type "cmd" in the start menu and open the cmd "Command Prompt" utility/tool/whatever
type "ping" then after that type the IP of the server you wish to join
After this, Malwarebytes gave me a notification saying "we've blocked your connection to this address due to fraud" (which was wrong) and that's how I found out it was Malwarebytes' issue.
hopefully this helps someone, but from what I've read no two issues of this kind are the same.