My 6 year old was asking me about this a few weeks ago. He's asking, how do our minds work? How did we come to be thinking and feeling and thinking about thinking? He says, "I know we're made of cells, but how did the cells... find their voice?" He's so fun.
Like a year prior to this, I stayed up all night trying to Google it, I guess for some reason I thought the answer would be a little clearer but apparently it's highly debated and mostly unknown.
One approach that I'm reasonably sure is correct is "emergence". A bunch of simple systems come together in a way that forms a more complex system than any of its individual parts. You can find this in many areas:
computers are made up of very simple basic units that come together to do incredible things
games can have simple systems that produce complex behaviour when taken together
biological systems follow similar patterns
It just seems right that consciousness isn't something that evolved as a standalone thing, but instead is the result of more and more simple systems coming together. We didn't wake up screaming one night in the face of the sheer terror of existence, it was a choir that gradually got louder :)