Consider a rainbow. It looks like a colored thing in the sky. If it is complete enough it seems to come down to earth at specific points. We even talk about "the end of the rainbow". We definitely see it, we have a real physical and also subjective experience of seeing a rainbow. We can even photograph it.
HOWEVER, there is no "thing in the sky". There are no "places it comes down to earth". The particular experience we have of seeing a rainbow is specific to the point where we are standing, the angle of the sun, the rain in the air, etc. none of which are part of our idea of a "thing in the sky".
So is a rainbow an illusion? It is certainly real in that we see and can photograph it. But also it is not at all the kind of THING that it seems.
Consciousness is also real. We can experience conscious periods, remember them, and with advancing imaging tech someday we can photograph them in the brain.
On the other hand the underlying reality of our conscious experiences isn't very much like our experience. Also, conscious experiences can be observed in meditation and other altered states in ways that make them seem very much like illusions.
So is consciousness an illusion? Yes and no, in the same way as a rainbow is and is not an illusion.