Basically it's a long and involved process. Don't forget universities offer doctoral programs in music.
If you truly want to become more than a club fisted hacker at the keyboard (like I am

) you basically have to study music theory and the scales and the chord structures as well as learn to read sheet music notation all the while learning simple tunes and arpeggios along the way and build your skillset from there.
How quickly you learn will depend on both your abilities and your commitment.
For most people who want to master their art it's a lifelong process.
To start out with, buy a few beginners playbooks and a couple of good books on music theory for dummies and spend a few bucks and take a few lessons as well.
Some people do better without a teacher while others excel with a good instructor. Again that's up to you and your age and temperament.
The internet is full of great resources, including youtube tutorials and also websites devoted to instruction on both beginner and advanced music theory. I have a page full of them linked up here.
https://www.keyboardforums.com/threads/good-tutorial-links.24556/
And most of all, get to know your instrument. Learn to develop your musical ear as well as get a feel for the keyboard. The more you practice the quicker you will learn.
Gary
