You are correct, our whole body, the planet, and even the sun and stars are entirely made of chemicals. But this does not mean that anything is predefined. There are still infinite possibilities for how these chemicals will form and interact.
In the body all the most important chemicals such as the DNA which carries information and the proteins which carry out actions and provide structure including for our muscles and nerves, are all made of a relatively small number of chemical subunits which can combine in an almost infinite number of ways. The DNA has four such subunits, and the proteins have about 20. But they always combine in very long chains which then fold upon themselves to form chemicals with special shapes. There's a never-ending constantly growing and changing variety in how just these two chemicals form in our bodies, and in all life for that matter. Add to this the many other important chemicals in our bodies such as RNA that are also made of long infinitely variable chains of a few subunits. Also consider the whole range of proteins in us (and all life) that are designed to have one end that is highly variable, capable of having literally trillions of different and unique chemical forms that interact with the outside world. These are the molecules (or chemicals) within us responsible for (among other things) the immune system, the senses of smell and taste. In the brain there are chemicals that act as bridges between nerve cells. There are not that many of these types of chemicals, numbering in the hundreds, but the potential connections they make between cells can happen in trillions of unknowable ways. While nobody knows for sure, it is believed that this is how memories, thoughts, and consciousness emerge. Some of the larger organization of all this is predefined (i.e. all people have two arms and two legs, two sides to the brain) but the fine detail at the chemical level has a certain amount of randomness and variability so that every person is unique and different.
However, as I said, we really do not know how any of that works. There are theories, and brain scientists have had glimpses of how thinking works using very crude imaging techniques, but fundamentally no scientist truly knows how thinking and remembering works, nor how we all begin from a single egg cell and then through many involved chemical processes develop into completely unique individuals. There is a lot of randomness, a lot of variability, and a lot of other factors that are involved, most of them remaining mysteries to science.
making a small donation to science.ca.