looking to know solutions preventing attack at system files

looking to know which files are mandatory for internet connections in system,i’d like to hear if it’s happen via either tcp or udp. UDP always easy to connect with hackers to send /receive files. please provide name of the file system(.exe) are utilized greatly for internet communication with simple browsing.

i’ve been using comodo firewall ,it’s been blocked some files but ,some hidden files have direct connection with public network from my home LAN.

I’m ready to make some applications safe which are highly used for daily applications.your feedback is important to not face similar problem by others.