Hello, I've never coded before and I'm trying to get some lights to change color periodically. I've found some prewritten code lines but I'm getting really confused as how I'm supposed to apply these changes to a set of objects. All help would be appreciated. Also this is in C#
You can look at the Light API it has details on how to edit things on Lights such as color. If you are asking how to do something in Unity you should read up on some details about Unity. You can learn more about Unity via Unity Learn.
Having experienced code in some form previously is ridiculously useful IMO. Unity adds a whole other layer of complexity and knowledge on top that I usually recommend learning outside of the Unity environment. What you're probably looking for: Storing references to the lights you want to change, either by making public variables, a public array or list or using FindObjectsOfType. Coroutines or InvokeRepeating to change the lights at an interval. As @TheHighGround mentioned, the Light API