You could buy a book, you could hire a personal tutor, but most foreigners who come to China to learn Chinese choose one of the following two ways:
Many universities in China, especially those in Beijing and Shanghai, offer Chinese language learning programs for foreigners. If you enroll, you'll feel like you're back in college again – because you will be.
The universities with well-known Chinese programs, such as Shanghai Jiaotong, will have large class sizes; expect around 80 students to 1 teacher. Schools with less well-known Chinese programs, such as the Shanghai Theater Academy, will have smaller classes, maybe 20 students to 1 teacher.
Because students come from different Chinese-learning backgrounds, most universities offer three levels of classes: beginner's, intermediate, and advanced. Beginner's classes are for students who have never studied Chinese in the past. Intermediate-level classes are for students who've had a year of university Chinese and know about 1500-3000 Chinese characters. Advanced-level classes are for students who've had two years of university Chinese and know about 4500 Chinese characters. Universities will test incoming students and place them in their correct class level.
Actual Chinese-language instruction at most universities is only in the mornings, from 8am to noon. After lunch, you can either just continue hanging out with your friends or attend optional elective classes – such as calligraphy or martial arts – that are included in your tuition.
Expect tuition to fall in the 1200-1500 USD range per semester for most schools. Room and board will be extra. Many universities have dorms for foreigners; expect rates of about 150 USD/month to share a double room.
Keep in mind: If you're interested in a Chinese program at one of the more popular universities, don't wait until the last minute to apply. Application deadlines can be up to 5-6 months before the actual start of the semester.
Chinese centers are basically Chinese language schools for foreigners set up by for-profit companies. They are much more expensive than university programs, but are also much more accommodating to your schedule. There are many more options for program length rather than just semester- or summer-long. There are also evening classes to choose from if you work during the day. And class sizes are generally much smaller, meaning more one-on-one time with the teacher.
Which Is Right for Me?
The answer really depends on how much time and energy you can devote to learning Chinese. If learning Chinese is going to be your main objective everyday, then by all means enroll in a university. If you still feel you could use supplemental instruction, you can enroll in an evening class at a Chinese center anytime. However, if you plan on learning Chinese while holding a full-time job, then Chinese centers, who will work around your schedule, are pretty much your only hope.
Some universities host on-campus Chinese corners, which are informal gatherings of foreigners interested in practicing Chinese with each other and curious Chinese.
There are also many young Chinese willing to participate in a language exchange. You teach them your native language and they will teach you Chinese. They're not qualified teachers, so they're no substitute for a good school, but they definitely can be valuable learning supplements.