how to send data from a sensor over serial to another arduino

Hi,
please can you tell me how to send data from a sensor (the IR receiver) from the first Arduino (the one with the IR connected) to another Arduino via serial communication?
I tried some different codes from the Internet, but they do not seem to work. The one without syntax errors turned out to be unworking... at least, someone on this forum said that.
I tried asking before about this, and as comprehension problems have arisen, here is a scheme to make all clear:

Remote controller > IR receiver > First arduino > Second arduino

I can't find a way to send data collected by the IR receiver from the first arduino to the second one.
Please help me...

I tried some different codes from the Internet, but they do not seem to work.

How do you know? How have you connected the Arduinos? What code are you trying to use?

Sending data via serial is done with Serial.print() or the same method in the SoftwareSerial, AltSoftSerial, or NeoSoftSerial software serial instance.

Did you connect the grounds?

Show the code that got closest to your goal. What did it actually do when you tried it?

Which Arduino boards are you using? Have you seen the serial input basics tutorial?

I did not connect the arduino board, the software reported some errors. I do not actually understand how to send the HEX values from the IR using the Serial.write() command... and how to store them in the second arduino using the Serial.read() command.

This is a code I tried for the sender...

#include <IRremote.h>


int receiver = 2;

IRrecv irrecv(receiver);      
decode_results results;  

void setup() {
  // Begin the Serial at 9600 Baud
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    
    Serial.write(results.value);
    irrecv.resume(); // receive the next value
    delay(80); 
  }
}

//code valid per sender

The technique in the third example in Serial Input Basics wll be the most reliable.

You can send data in a compatible format with code like this

Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker

What Arduino boards are you using? If you need multiple serial connections then things will be a lot easier if you use a Mega.

...R