Read CID from SD card with ESP8266
To print the serial number in hex Serial.println accepts a format parameter:

Serial.println(cid.psn, HEX);


The cid variable is a struct so you can access the the other fields via the structure. But if you really want to access the raw bytes you could cast cid to a pointer then access the individual bytes:

uint8_t *rawcid = reinterpret_cast&lt;uint8_t*&gt;(&amp;cid);
Serial.println(*(cid+3), HEX); // print the 4th byte


Be aware that casting like this can be tricky and you will likely shoot yourself in the foot more than once.