question about server client code in C

If I have two files server.c and client.c, how do you demonstate the client reading something from the server?
so say i have a server,c and a client.c file in a unix machine (same folder), and i want the client to connect and write something to server (through the internet), then server returns it back (and changes something), and client prints it to stdout.

Does that mean that only the client.c has to be compiled and run? Or how would one compile it?

The client has to connect to something, if the server isn't running the client will get connection refused.

You would compile client.c on the client machine and server.c on the server (or at least run it there)