Start with Google: a quick search for C# server/client chat gives a huge number of results:
Google[
^] - including a number of articles here.
I know it may not be a chat program you are trying to write, but the fundamentals are the same: connection and data transfer.