Before any data flows, TCP makes both sides prove they can hear each other. The client sends a SYN, the server answers with a SYN-ACK, and the client confirms with an ACK. Three messages, and now both sides know the line is live in both directions.
That tiny ritual is what makes TCP reliable: sequence numbers exchanged during the handshake let both machines detect lost or out-of-order packets for the rest of the conversation.