Rinse and pat dry the beef heart with paper towels, cut off excess fat and membranes. Cut the heart into small slices 3-4 inches long and 2-3 inches wide. Put the pieces in a bowl.
Add 2 tbsp olive oil, salt and spices on top of them. Mix thoroughly. You can leave for 1-3 hours in the refrigerator, covering the bowl with a lid to season the best.
Pour the flour into a plate. Cover each piece of beef heart in flour to coat completely. Transfer the beef heart pieces to a pan with hot olive oil. Fry on medium heat for 3-4 minutes.
Flip the pieces and fry for another 3-4 minutes on the other side, covering the pan with a lid each time.
Transfer to a plate lined with paper towels to soak up excess oil. Cut the onion into thin strips and fry in olive oil for 5-7 minutes, stirring occasionally.
When the onion is soft, add sugar and continue to fry for another 5 minutes until the onion turns brown and soften. Transfer the beef heart pieces to a plate, top with caramelized onions.