I think it would be easier with something like this:
Or similar, there are others. You can search for "Arduino LED driver" module.
You have to understand how circuits work. Calculate for your concrete circuit what will be voltage drop, the current and the power of that resistor if you do that. And what you want to achieve with that.