Well, it comes down to learning how to debug - stepping through a program often line by line, seeing where an error occurs, then looking at variable contents to see if they match what you expected
So, set a breakpoint on this line
var baseUrl = "https://www.googleapis.com/youtube/v3/channels";
then start single stepping using F10 'Step Over' and F11 'Step Into' (functions etc) until you find where it's going wrong - as you find area(s) of concern, you may need to add logging/diagnostics to help you 'see' state/what's going on - often a Console.WriteLine etc with some text & variable will give you a pointer
btw, I suggested setting a breakpoint on that line, because at some stage, execution would 'skip' to that routine & through it, if you didnt set a breakpoint you'd likely miss the fun
This is something we can give you guidelines on, but ultimately, we cant do for you, since it's your code on your machine. By large, we out here write functions and tests for them as we go, so we dont get 'caught out' by nasty surprises