Need Help With WaveShare VOC Sensor

for a start initialise the Serial before attempting to initialise the SGP40, e.g.

void setup() {
  Serial.begin(9600);                // Initialize serial communication
  if (SGP40_Init() != 0) {
    Serial.print("init err!!!"); // if theres an error in the VOC sensor return this
  }
}

what microcontroller are you using?
give a link to the particular SGP40?