The first thing you would need to do is take a detailed course in computing and in particular the different coding languages used when making computer software. An example of this is the 'C' language (and its variants).
The alternative to this is to try and educate yourself about programming languages from a book. Both these methods require dedication and a lot of time to master.
Gaining a detailed understanding of the language used by programmers will allow you to learn about how the computer language is structured, thus illuminating the inherent strengths and weaknesses of any programming system.
This will then allow you to be able to read through code and pick out potential weaknesses in the code that can be exploited.
While hacking is generally viewed as a negative thing (and is considered illegal when it is used to hack into programs for criminal means, sending spam, harvesting personal information, for personal financial gain or to merely cause a nuisance to the end user) many companies will employ the services of hackers who search for inconsistencies and weaknesses in their software and highlight them to the programmers.
Unfortunately, returning to the initial question, this must be advised against if the questioner is seeking information on how to hack into and access the balance of another person's mobile phone. Not only is this illegal to do, but providing clear instructions on how to do this on a website such as this would be a breach of the law too.
Alternatively, if there is a genuine reason for wanting to access this balance and permission of whose phone it is has been sought, it may be beneficial to contact the phone manufacturer or mobile service provider to see if the issue regarding the balance can be resolved in another way.