I’ll make this really simple
Eat 1-2 hours before working out. Protein and carbohydrates. The bigger the meal, the longer it takes to digest
After working out: eating sooner is generally better than later. You’ll recover faster. That said, if you had a preworkout meal, you can wait an hour or 2
If you train fasted, eat as soon as possible