Trying to close open port 5900 or find process that opened it

Solution 1:

TeamViewer is a proprietary protocol not the same as VNC. However, macOS has screen sharing (VNC) built-in. Turn it off in System Preferences->Sharing->Screen Sharing:

enter image description here