The first step is to admit that the extensive awareness that people have of their environment, comes at a high price.
people have very high resolution sensory apparatus, their brain have had an enormous amount of time to perform statistical inference on this sensory data, and they impose an abundance of learned arbitrary cultural constraints upon this data to further simplify it.
The field you are looking for is Artificial Intelligence, and it's many side and sub-fields, machine learning, statistics, data-mining, digital signal processing, heuristics and search, and others.
A program that is going to have awareness of human needs, should ideally try to predict what the human will need given abundant past sensory data. you will need to collect this sensory data first, and then collect information on what the human wants or needs. then use AI techniques to predict the latter given the former.
However, even if you do manage to do this, extensive learning will be required. According to some philosophers of AI, no system doing this could really have a convincing awareness of our needs without experiencing life as a typical human itself.
But going ahead with the problem anyways, I assume humans need food, sleep, water, comfort, and autonomy. all further needs could be expressed as subgoals of these needs. so if the program had a dependency graph of all the things one needs in order to have something else, and if it knew what a human had already, then it could determine what that human still needed. (what that human thinks he needs is another story...)