I usually reach out to one of the electrical engineering team in my family for this, but they are out. I think you calculate the resistance by: R = (Vin - Vf)/If where R is the resistance you need, Vin is the DC input voltage, Vf is the forward voltage drop of the LED (should be specified in the datasheet) and If is the current required by the LED (also should be in the datasheet). Hopefully some much more knowledgeable than me can QA my answer. If I get an update from family will post again.
FYI I had this formula, but I found a much better explanation which I copied from another webpage.