Some basics: There are two types of programming languages - compiling and script languages.
A script language has a program called “interpreter” and that will read and execute your code on the spot. Those are generally easier to learn and use, as the interpreter can do A LOT of work on the fly and it can just run over the code the moment you start it. However this means the interpreter is running in the background and hence slowing down the program.
A compiler language has a program called “compiler” and that will take you code and turn it into an independant executable file. This means you cannot run or change code on the fly, because the ENTIRE CODE has to be compiled before it can be run. Because you don’t execute the code, you execute the file that is produced out of it. So there is no difference inbetween changing a single character or changing thousand lines - the compiler has to compile everything new.
Compilers are harder to write and use as you have to make sure the final file is able to deal with everything you throw at it. There is no program on top working for you, also meaning they are generally a lot faster in execution.
For example, compiler languages need you to specify what datatype variables are. If you say something is an integer, then it can only hold integers. However if you give a float to an integer in an interpreter-language, the interpreter can just change the datatype for you.
Now there are some languages trying both, but I am no expert on them.
Because everything your write is text, the file extension doesn’t really matter, unless you got an IDE with additional features. Ofcourse using an IDE is the preferred way to write code instead of plain text editors.
With that said, without an installed compiler/interpreter, no code you write can be truned into anything. Because it’s just text. However a computer is a machine that has to run code all the time, so there are ways to have code get executed on a native machine. Like, if I write a command in the command-prompt, I obviously want it to interpret the text and do something.
Buuuut - in the end, for more complex tasks you’ll grab an IDE, even if it is lightweight. Simply because of the programming language you use and because even basic features like code-highlighting or automatic indentation.