This is a really open-ended question, since "netstat" shows a bunch of different things. However, if you just want to see which process is using a currently open connection/session you can use the "lsof -i" command in the Terminal. Once you know which app is using which port(s) it's often easier to determine if that's something you want or need. Figuring out all the other ports is a bit more complicated, since listing ports don't always have a running app associated with them. However, they're usually associated with some service which is enabled on your Mac, such as file sharing, etc. but identifying all the background services that might be important can be a bit daunting. If you really want to prevent access to your Mac on a particular TCP and/or UDP port then you can use the old "ipfw" firewall feature to block it, but it's complex. There are free utilities out there that can help make it easier to use, but even so you should know what you're doing or you can easily break network access to/from your Mac.
HTH - Good luck!