Prepare the tofu by heating 2 cups oil in a pot. Deep-fry tofu until golden brown. Set aside.
Prepare the sweet and sour sauce by combining sugar, ketchup, vinegar, soy sauce, and water in a bowl. Mix well. Set aside.
Scoop around 3 tablespoon of cooking oil from the pot where the tofu was fried. Pour it into a clean pan. Heat oil and saute garlic until it starts to brown.
Add onion. Continue sautéing until the layers are separated. Put carrot, pineapple, and bell peppers. Saute for 2 to 5 minutes.
Pour-in sweet and sour sauce mixture. Stir and let it boil. Continue cooking in low to medium heat for 2 minutes.
Thicken the sauce by combining cornstarch with 3 tablespoons of water. Mix and then pour into the pan. Stir until the sauce thicken.
Add fried tofu back into the pan. Stir. Serve hot.