How to properly organise source code is closely related to the proper organisation of concepts which a programmer would use to devise the source code for a particular application.
As such, cohesiveness and coupling are as much properties of an abstract system of concepts and ideas, as they are properties of the source code which is written to represent those things.
The need for this organisation is because it's very rarely possible to represent a useful application as a single procedure.
This might be because it does too many things that it would become difficult to keep them all in mind at once, and once we start to interact with paper to extend our mental faculties and allow us to design things more complicated than we can keep all in mind at once, we then need to ensure that the things represented in paperwork remain navigable and that it assists our minds in a convenient way.
This is essentially the underlying reason for various kinds of "modularisation" - it organises the conceptual content of written material in a way that facilitates our continued interaction with it.
Source code is also unusual amongst human written material in that it also serves to drive the activity of a computer, and can do so independently of any immediate human attention, and this can cause people to forget that source code is a tool whose primary user is the human, and which is primarily tailored for human use.
Most humans have a good facility for understanding and recalling the "function" or "purpose" of things in the world, and less comprehension for the fine details of the steps involved in the things whose overall purpose they might know. A computer, by contrast, has no comprehension of function or purpose at all, and knows only the fine details of steps it is capable of executing.
Source code is a special form of writing which is supposed to appeal to both - it includes natural language elements and visual layouts that facilitate it's human use, whilst still representing in very fine detail the steps which the computer should execute when that code is being used in its capacity to control a computer.
"Cohesion" and "coupling" are basically an attempt to describe the desirable properties of a "module" or a high-level concept. A module must, by definition, consist of more than one concept internally - otherwise the thing would just be a concept, not a module of them.
"Cohesion" concerns the internal relations of a module's concepts. Cohesiveness means that the internal concepts relate to each other "naturally" - that is, they obviously go together, they are all necessary to fulfil the function of the high-level module, and they are not supernumerary or unnecessary in regard to the high-level function of the module.
"Coupling" concerns the relations that the module has with other modules. Here, relationships should be as simple and minimal as possible, whilst still fulfilling the overall function of the system of modules (or the whole computer application).
A lot of this stuff is far easier said than done - easier discussed amongst professionals who already get it, than useful as guidance for learners.
It is not necessarily the case that maximising cohesion or minimising coupling is desirable.
Completely uncoupled modules would be separate applications which have no interactions - so within an application, you certainly don't want to eliminate coupling altogether, only to control it.
And a module that is fully-cohesive conceptually, might require a lot more design work than is really appropriate for the task, or may require a "bag of tools" module in source code to be split off unnecessarily when it otherwise suffices to be understood as a bag of tools that does various minor or common things in the application (which are not complicated enough individually to require any modularisation in source code).
Ultimately, there are all kinds of complicated professional judgements involved which make it more like an art, which are poorly described in literature, which take a long time and a lot of experience to acquire, and which are somewhat context-specific to the industry or size of business which may be commissioning a computer application.
Another problem is that, because modularisation is about organising complicated concepts which even expert programmers cannot grasp without employing additional techniques to manage the complexity, it is difficult to set up scenarios which demonstrate to learners the difficulties which modularisation relieves, or how modules should and shouldn't be designed, using any kind of simple examples.
A procedure of two-dozen lines, as this question starts with, is hardly sufficiently complex to need modularisation, let alone to begin to demonstrate what different levels of coupling and cohesion would look like.
The problem with employing complicated examples, however, is that they are difficult to articulate (in this site's format, for example), they would require real sustained effort from a professional educator to devise significant-sized codebases for conceptually-complicated applications which demonstrate the contrast between good and bad qualities, and the scale of the examples would then require considerable engagement and study for the learner to start to interact properly with the written code and start to properly perceive its ergonomic qualities.
My advice, therefore, is that as a practitioner you will quickly encounter situations where the limits of your mind require you to modularise just to stay in control of the design, and you will then naturally start to appreciate the quality of cohesion and coupling amongst these modules (because appropriate improvements should make the design seem subjectively easier for you to work with), and you won't need to ask anybody else what they are but will instead recognise the words that other professionals are using to describe those qualities.
Asking, as a beginner, how to operate on a simple piece of code to make it more cohesive or less coupled, is completely the wrong question. Because if you have code that needs to be more cohesive or less coupled, your question would be: "I sense I've lost control of this codebase and can no longer grasp what is going on. My colleagues cannot understand it anymore. I'm overwhelmed by the complexity of designing this application. How do I regain my ability to work with it?". And that wasn't your question.
DataServer2object and is therefore tightly coupled. There are different types of dependencies. Data sources (file system, network, data base etc.) are one type of dependency where it's valuable to decouple from, replacing it by an interface for which you can inject a concrete implementation. This helps with testing but of course also allows to replace it with little effort later in production.