How can i connect two Arduinos

Hi.How can i connect two Arduinos which runs in the same computer in different ports and they runs different program

Hi.How can i connect two Arduinos which runs in the same computer

The Arduino doesn't "run in the computer", so you entire post is meaningless.

I want two different Arduinos which they are connected to the same computer to matches in different ports.Because when change one port of an arduino then changes the other one

If you open two instances of the IDE, by clicking on the executable, the serial port in each one will be independent of the other one.

If you open a second instance by using the File + Open menu item, the instances are linked, and changing the port in one changes the port in the other.

You can also communicate with different ports using terminal emulators such as Tera Term or Putty, instead of using the serial monitor in the IDE if that is what you need to do.