Thanks for posting your best efforts at coding. Are their libraries for the NDIR HC SJH-5 or will you be doing an analog read thingy?
Post a link the the sensor's data sheet.
Post a schematic of the circuit.
Post an image of your project.
None of your posted code indicates you did any of that.