I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming.
Unless you write a network daemon, most networking in C can be done at a higher level than using directly the sockets, by using appropriate libraries.
For instance, if you just want to retrieve a file with HTTP, use Neon or libcurl. It will be simpler, it will be at a higher level and you will have gratis SSL, IPv6, etc.