Boil the spaghetti noodles.
Finely chop the onion and garlic.
Heat olive oil in a pan and sauté the onion and garlic.
Add ground beef and tomato sauce, then bring to a simmer.
Mix the cooked noodles with the sauce.
Transfer to a gratin dish and sprinkle cheese on top.
Bake in the oven at 200°C (392°F) for 10 minutes.