Boil the spaghetti in boiling water.
Slice the onion, bell pepper, and ham.
Sauté the onion, bell pepper, and ham in a pan with olive oil.
Add the cooked spaghetti to the pan and stir-fry.
Season with ketchup, a pinch of salt, and pepper.
Once everything is well mixed and cooked, transfer to a plate and serve.