Needing help with coding workflow

Needing help with coding workflow

I'm not great at coding and haven't been able to get a lot of help. I'm struggling to get this coding right and nobody has been able to solve it yet. I will try to summarize and explain as best as I can.
We have a parts form with all of our parts that go to our products. When we assemble our products we have an assembly form so that when we put in the product and quantity it will subtract all the parts necessary to create that product and updates our inventory. When we want to update our stock for our parts we have an Add stock form that will update our part quantity.
I want to have it so when I add one specific part (Identifier Cap Standard) that it will subtract that number being added from the (Identifier Cap Pre Laser) Part. These part names are in a lookup field to my parts list. We use the Pre Laser part to create the Standard part which is why I want it to subtract. Is there a way I can just set up a workflow so my numbers only change when inputting the standard cap? If this doesn't make sense I can clarify. Here is the code support helped me with but it does not work (I assume because the specific part names are not in the code). I also don't know if they understood what I wanted fully.
fet = Parts[Part_Name == input.Parts.Part_Name];
fet.Current_Quantity=fet.Current_Quantity - input.Quantity_to_Add;