The right function or method when creating applications, software, web and other software


I am a beginner student learning programming, I have learned about variables, data types and so on.

But why isn’t it as easy as making an application, the software that I imagine? I was confused when I read the programming documentation

And when do we need a method or function from php programming documentation or java, android or other programming language documentation?