Questions on single-script architecture

So I have recently been looking at modular scripting and single-script architecture and I am struggling to understand how it actually works.

Thanks.

Can you please be more specific? What is your question?

I am getting confused on how it can be implemented.

Module scripts are useful as you can use whatever functions or variables inside it, and then when it is being taken by another script, the script is able to use whatever functions or variables inside it. It is useful for OOP, and prevents you from copy and pasting the same function in multiple scripts.