Cut the tofu into approx. 2 cm cubes. Press the garlic, mix with the sesame oil and soy sauce, add to the tofu, mix well, cover and leave to marinate for approx. 15 mins.
Heat the oil in a wok or a wide-bottomed frying pan. Stir fry the tofu for approx. 5 mins., remove and set aside.
Cut the onion into small wedges, cut the pepper into approx. 2 cm pieces. Drain the pineapple, retaining the juice, cut the pineapple into pieces.
Heat a dash of oil in a wok. Stir fry the onion and pepper for approx. 5 mins. Mix the pineapple juice with the water, soy sauce, vinegar, ketchup, cornflour and sugar, add to the vegetables, bring to the boil. Add the pineapple and tofu, heat gently, season.
Serve with rice.