Waiting for a byte to received in the Serial buffer before moving on

my program sends 2 bytes, 1st is pin number, the 2nd byte is state, a 3rd could be sent with a checksum which the RX will then send back to TX to confirm