How to combine two different sensor sketches to one complete sketch?
I will leave a simplified answer and I would recommend to read https://www.makeuseof.com/tag/getting-started-with-arduino-a-beginners-guide/ or similar to get a understanding of how to code.

An Arduino sketch has a structure.


Initialising values
A void setup() this code only run once the MCU is started
A void loop() and this code runs continuously.


So to merge two sketches you need to combine the code that is in the same sections and of course avoid duplicate code and ensure that you have unique variable names

Sharp Dust Sensor

int measurePin = A0; // Connect dust sensor to Arduino A0 pin
int ledPower = D8;   // Connect 3 led driver pins of dust sensor to Arduino D2

void setup(){
  Serial.begin(9600);
  pinMode(ledPower,OUTPUT);
}


MQ-135 Sensor

int airquality = A2;
void setup()
{
  Serial.begin(9600);
}


Combined code

int measurePin = A0; // Connect dust sensor to Arduino A0 pin
int ledPower = D8;   // Connect 3 led driver pins of dust sensor to Arduino D2
int airquality = A2;

void setup(){
  Serial.begin(9600);
  pinMode(ledPower,OUTPUT);
}