Fatal error: avr/io.h: No such file or directory

Where is this code from? That sensor doesn’t use a library, it interfaces directly using Wire (you don’t need the "#include “SparkFun_Soil_Moisture_Sensor.h” "

Try running the code here Zio-Qwiic-Soil-Moisture-Sensor/Firmware/Qwiic Soil Moisture Sensor Examples/Example1-Basic_Reading/Example1-Basic_Reading.ino at master · sparkfun/Zio-Qwiic-Soil-Moisture-Sensor · GitHub or trying the guide Soil Moisture Sensor Hookup Guide - SparkFun Learn