With a four or five year old, you can have specific consequences for bad behavior(like the loss of TV time) and good behavior (a special treat), and it works quite well. A two-year-old, however, cannot see the relationship between this behavior now and a reward or punishment later. They also do not have much self control, and you cannot reason with them to get their cooperation. When they have tantrums, you need to ignore it, and not give in, even if the tantrum is in a very public place. Also, I would absolutely avoid any type of physical punishment.
The key to disciplining children at this age is to give them a little bit of control about behaviors or decisions that are of no importance, while clearly and consistently enforcing the rules that are important. You truly need to pick your battles. Does it really matter that your two-year-old wants to wear one red sock and one green sock to go out to the supermarket? Probably not. Does it matter that she doesn't want to get into her car seat to drive there? Absolutely, and you have to put her into that car seat even if she screams the entire way to the store.
It is not easy to manage young children's behavior, and some the techniques that you read about in books are not always easy to enforce when you are at home alone. Many parents need some support with this. I would recommend that you contact a local parenting group in your town, and see if there are workshops or support groups available. Your pediatrician may know of other resources as well.