While oxygen is necessary for the process of respiration, glucose plays a crucial role in the diet; and that explains why the photosynthesis is important for all the lifeforms on the planet - including humans.
As a result, they carry out photosynthesis to release oxygen, then absorb the oxygen to carry out respiration and release carbon dioxide, then absorb this carbon dioxide and carry out photosynthesis and so on, in a never ending energy production cycle.
Cellular respiration steps - YouTube
The figure illustrates how closely photosynthesis and respiration are linked. As you can see, thanks to these two life-sustaining processes, plants and animals depend on each other to survive.