Bacteria are like tiny machines that respond to what’s happening around them. So for example, they have receptors for particular chemicals and when the receptors pick them up the cell responds by producing a protein. None of this is done consciously, though. The environment just sets of a set of reactions inside the bacterium.
It is difficult to define what consciousness is. If you define it as how the brain perceives itself and reality around it, then bacteria cannot do anything consciously. However, the same molecular signals that make a bacteria react to their environment may also control our actions in life. There may not be so much difference between us and them.