What are you trying to connect them for?
If you are trying to put the 2019 MacBook Pro into Target Disk Mode, you'll need a Thunderbolt 3 or Thunderbolt 4 cable – not just a regular USB-C cable. These days, there's a restriction on Target Disk Mode such that if either of the Macs is running Big Sur or later, the connection must be a Thunderbolt one.
Transfer files between two Mac computers using target disk mode - Apple Support
Note that if you are trying to migrate things from the old Mac to the new one, an alternative might be to back up the old Mac to an external drive, connect the external drive to the new Mac, and point Migration Assistant at it.