You cannot train a cat in the same way as a dog as they do not respond to specific commands - how many cats do you know that will "sit" and "beg" on your command? Cats are naturally a remarkably clean and fastidious animal and will usually learn quite quickly how to use a litter tray.
We have had mixed success rates with litter training kittens. We have put some kittens in the litter tray and they instinctively go back there but others have simply refused to use the litter tray and have always found a nice cosy corner of the room. The problem for us was that we were out at work all day so we could come back home in the evenings to be greeted by a new litter tray in yet another corner of the room!
The other problem here is that once one of the kittens start using a corner of the room, the others think that they should be using it too.
You really need to spend a fair amount of time with the kittens continually picking them up after eating or drinking and putting them in the litter tray. You can also buy a spray that attracts them to the litter tray and we did have some success with this.
Cat urine does not do the carpets any good and if you allow the cat to continually use the corner of a room, you will soon find that the carpet discolours and you can never really get rid of that awful smell.
You could use a "pet behave spray" which is basically a spray that can be applied to any soft furnishing - carpets, stairs, settees etc and will deter the cat from going near as they hate the smell. We use a lot of this whilst training the cats!
You will also need to clean the litter tray daily if you have more than one cat - we found that they would refuse to go in the tray if it had been used too many times. In this case they would take to the garden and dig up my plants!
There are many types of cat litter trays but we have always used the open tray for the kittens and the covered tray for the adults. The covered tray does mask the smell and you do not need to be constantly looking at cat waste but we found the kittens were too small to climb in it so they used an open tray, placed next to the covered one, until they were big enough to get in it.
The final problem we had was that the kittens could not distinguish between food and the litter tray. We would place a kitten in the tray after eating and all it would do was eat the cat litter! We also found that they used the bowl of cat biscuits as a litter tray!
The only solution is perseverance and a willingness to clean up a lot of cat waste before they finally learn where they are supposed to go! You should never scold a young cat for fouling in the wrong place and certainly never rub its nose in it.