Are you using 2 UNOs? Or, one UNO as Master and one ATmega328P chip as Slave?
How many buttons are you using at the Master side to input your data/command? In which digital pins are they connected?
In Arduino I2C Management, the rceiver section is interrupt drive. So, whenever a data byte arrives at the receiver (TWDR Register) due to the execution of Wire.write() command at the Master, the Wire.onReceive() message is triggered which in turn calls upon the user-defined ReceiveEvent() routine. So, in the setup of the Slave codes, you must initialize the Wire.onReceive() function with the subroutine name as its argument.
There is also Wire.onRequest() message which is triggered in the same way as the Wire.onReceive(); but, this time it is triggered due to the execution of the Wire.requestFrom() command at the Master side.
If you are learning the I2C communication protocol, use two UNOs and keep practicing some simple data communication examples.