In my experience there are two firewalls that are shipped with desktop linux distros Gufw and Firewalld. This guide will go over how to open port 25565 (the default Minecraft Server port) on both of them.
Go to the search bar in your distro and type in firewall. Open the firewall application that comes up. In the firewall aplication there is a help button near the top of the screen click it then click about if the about page says Gufw follow the Gufw guide if it says firewall-config follow the firewalld guide. Some distros do not ship with a firewall in this senario you can install whichever firewall you want or skip this guide.
Run "sudo ufw allow 25565 &&sudo ufw allow out 25565" in the terminal.
Go to the Rules page (next to Report and Log) and click the + in the bottom left to add a rule. I recomend using a simple or preconfigured rule. For a simple rule choose "Name:Minecraft Policy:Allow Direction:Both Protocol:Both and Port: 25565". For a Preconfigured rule choose "Policy:Allow Direction:Both Category:Games Subcategory:All Application:Minecraft" (put "Minecraft" in the "Application Filter" so you don't have to scroll forever).
Go to the Ports page (next to Services, Protocols, and Source Ports) and click the add button. For Port/Port Range: 25565 and for Protocol tcp. Do the same thing again but use udp for the protocol this time.