You get training bars by giving them time outs/praise or punishment/praise (depending if you have a Connection or Connexion). Usually if it's crying or has a dark cloud next to it with its back turned to you .... then you praise it. You give it a time out/punish if it's just beeping and it looks fine and all your happiness/hunger hearts are basically full.
Usually some wavy lines will appear on either side of your tama when it's about to take a poop. Then you can click the toilet and it goes in the potty. If you don't see it, it'll just poop on the floor and you just clean it up and either way it'll be happy
Try looking through the other pages in the "Help For New Pet Owners" category on this site, lots of your questions will be answered ^_^ Have fun!