Cut tofu and tomatoes into bite-sized pieces.
Finely chop the onion and garlic.
Heat olive oil in a pan and sauté the garlic and onion.
Add tomatoes, season with salt and pepper, and bring to a simmer.
Add the tofu and simmer together.
Transfer the ingredients to an oven-safe dish and top with cheese.
Bake in a preheated oven at 180°C for 10 minutes until done.