It seems crushingly obvious to have to say this, but it is;t realy a 'hard problem'.
Living organisms need to interact with the non-living environment to survive. The more complex the life-form, the more elaborate the interaction. Sessile organisms such as plants need only basic interactions -roots seek out water and nutrients, leaves and flowers turn to take advantage of sunlight. Mobile organisms require more elaborate sensory apparatus, a brain capable of decoding them, and a centre (the creature itself) from which to measure distance to food, etc.. These, then, are the beginnings of a separation between the self and the environment. The living thing perceives itself as something moving within the environment, rather than simply being a part of it.
Evolution, being a fairly random process in the sense of producing virtually every possibility and leaving he product to sink or swim, throws up differing forms and types of consciousness.More developed consciousness we call 'intelligence' and note differing degrees and types of it in different creatures. Our own version has included the ability to modify the envronment to a greater degree than any oher creature. This requires a greater sense of separation from the environment than ost oher animals. So great a sense of self, in fact, that we feel compelled to question, evaluate and explore that as well as the outside. world.
So much for consciusness, or at least where it comes from. How it works physically (if indeed it does) it something that escapes us. Possibly, probably, we are to close to the problem. There is also the matter of the Observer Effect. Thought as quantum fluctuation? Wouldn't dismiss it out of hand. Mind as a bio-enegy matrix generated in or by the brain? No sillier than soem supernatural being giving us a 'soul'!