Double click on the error message. Then add a Debug.Log to check the values of the variables in that line of code. If one of them is null, go backwards in the logic flow of your program to figure out where an object is supposed to get assigned and when the/a variable doesn’t contain a reference or loses it. Use Debug.Logs.