problems connecting to a server

I’m working on a project that will connect to a server, but the problem is that although I have followed several guides and video tutorials have failed to do so . Some of you have already done such a thing? Could you kindly advise me how I should implement it?
Thank you all and hope to find a solution with your comments .
Good day