Obviously there's no way to conduct a high quality controlled experiment and eliminate bias. But you can play around with adding or removing certain foods from your diet. Look for correlations with how you subjectively feel, and objectively perform. You might find some effects that are large enough to be significant even with n=1. Or not.
How do you not?
You're living this life anyway, might as well try to learn from and compare your various diets.
Unless you eat the same meal every day for your whole life, I don't see how you could not learn something from it.
If I see comments providing diet advice with words like "undeniably", I lean toward downvoting them.