There are phenomena that have some of the properties of life but are not what we think of as life. There are also phenomena which we talk of as being life which actually are not life itself. I want to compare these systems with living systems.
The obvious examples of the first are viruses and prions. I would describe these as life-like rather than alive. They replicate and mutate like life (at least viruses mutate). But they do not maintain themselves and are not self-contained. They hijack the systems of living organisms. They do not use their own systems to replicate themselves. They do not manufacture their own components.
The important example of the second is consciousness. It appears to be a life-dependent process but is not life. We only know of it in animals with complex nervous systems. All known examples are dependent on brain activity. Damage to the brain or disruption of its activity by drugs affects the mind.
We do not know what the physical basis of consciousness is. We do not know if it can be explained by the actions of a network of neurons or whether there are as yet unknown physical principles involved. Our knowledge about consciousness now is comparable to our knowledge about life before the discoveries of the 1950s and 1960s.
We do not know whether life is necessary for consciousness. Perhaps it could happen in some computer-like machine. (I say computer-like because I doubt that it can occur in computers as we know them.) Perhaps the brain's ability to modify itself is involved. In that case a conscious system would have to be life-like in some respects.
However we do know that consciousness is not necessary for life. A seaweed is alive but not conscious. A human being in a coma is still alive as an organism, not just as a collection of cells.
The trouble is that we have no word for consciousness as an activity. We talk about the act of living, implicitly acknowledging that life is an activity. But we have no word for the act of being conscious. So we end up talking about life when we really mean the activity of consciousness. When we talk about human life we usually mean human consciousness. Brain death is the irreversible end of consciousness not the end of life.
This confusion has serious ethical consequences but I don't want to deal with them in this article.
We have only one known case of the formation of life from non-living systems. It probably happened on Earth or Mars over 2 billion years ago but after planetary formation 4.5 billion years ago. Eucaryotic cells first formed from prokayotes over a billion years ago. Animals , plants and fungi separately formed from protists at times from over three hundred million to probably about eight hundred million years ago. It looks like it is easier to form a new level of autopoetic organization from existing life forms than it is to form the base level of life from non-life.
There are several possible origins for viruses. They could be remnants of pre-cellular stages in the formation of life. They could be example of extreme parasitic degeneration. (When a life form becomes parasitic it tends to simplify and loose structures needed by free-living forms but not by parasites.) They could be rogue host genetic material and proteins. I think the pre-biotic remnant speculation is unlikely. I suspect that most of them originated as rogue host material. (Not necessarily material from their current host species. Viruses do jump from one host species to another.)
If you want to read further on the nature of life I recommend What is life? by Magulis and Sagan.