The local scope of a variable allows the variable to work inside a restricted block of code. For instance, if it is declared inside a function, you cannot access it from the main function without calling the function whereas the global scope of a variable allows the variable to be accessible throughout the entire program.
It is a well-established fact that whenever a program has a local and global variable, precedence is given to the local variable within that program.