They other way is much more difficult because you are trying to train your bird to talk with some thought process behind what he/she is saying. This is done by explaining to your bird what you or he is doing in a few small words. For example, my parakeet loves to eat apple every day so every time i am about to get him some i say to him "want some apple" and i will continue to say that each and every time i get him some until he associates those words with the action. Eventually i hope he will ask me for the apple.
Certain birds pick up the skill of talking very easily however not all birds are guaranteed to talk. Certain types of birds are known to talk really well so if you do want a talking bird i suggest that you research what those species are before you purchase.
African Grey's are a well known bird for talking, Indian ring-neck parakeets (which is what I have) are also known as good talkers. i have had my parakeet (Oscar) for 4 months now and he is already starting to shape his sounds into words, they aren't very clear yet but he is learning and improving.