Forecast icons question

In HTML/CSS/Javascript, how do you go about matching the forecast conditions from the API with a matching icon? I’m able to retrieve the data from the API, I just don’t know how to get the matching icon. I don’t necessarily need code examples, just a general idea. Thanks in advance for any help.