Best is to use Wikipedia, google etc, to get a synopsis of what DCT does.
For a full explanation, there are hundreds of monographs on the web.
However, the best way to comprehend what it does is 1) use a sheet of graph paper
2) create any image you can on paper
3) follow DCT algorithm to generate a block
4) then decompose that block.
You can see that the decomposed block does not exactly match the original, but it is close enough.
It is a "lossy" form of compression and saves a bunch of memory.