How can I play in the NBA, well there is a very short answer. 

To play in the NBA you will need to play at least 1 year of professional Basketball in another league or play College/University Basketball preferably in an NCAA school. The days of NBA players coming out of high school are long gone with the new rules that have come into place. 

There have been many high school Basketball players who successfully made the jump from high school Basketball to the NBA like Kobe Bryant and Lebron James. However there were lots more that never made the cut and landed themselves a job at the local McDonald's

There was one famous case about a 7 foot boy from Oakville Ontario (Ivan Chiriaev), Ivan was said to be the next Shaq but ended up as a bust not making the NBA in 2002 and being cut from a team in Holland in 2007. 

See once you have declared for the NBA draft you will need to hire a manager which then makes you a professional athlete in the eyes of the NCAA. If you are viewed as a professional from the NCAA you will not be able to play NCAA Basketball. 

Due to all of the failure cases the NBA has come to a rule that states you need to play a minimum of 1 year of post secondary school or pro Basketball for another league.