We are all different but in the end it's all about biology and psychology. Some things apply to all of us meanwhile some only apply to some of us.
Being rested is a major factor which determines whether you're able to stay focused for a various amount of time, having had a balanced amount of sleep (not too little and not too much, I for example simply feel empty in the head after too much sleep with a trace of a headache) is important.
Knowing when to stop after entering fully rested is important too, if that's an option (i.e. cash game), it's in the final hours of every event where people tell afterwards that they probably did plays they normally wouldn't have but did it simply because they were too tired to play it differently.
Some play badly when they got stress going on in their normal life, not being able to focus on the game, meanwhile others can use it in their advantage and sink into the game and completely forget their every day stress factors. For most it's probably best to stay away from the table for some time after experiencing some trauma or going through a rough patch, i.e. breakup etc.
Most pros who have published some material usually make a chapter or a paragraph about the matter, or talk about it in interviews. Staying physically healthy is important for many of the pros as it will enable them to feel better physically and that usually results in feeling better mentally as-well.
Needless to say it's probably best to avoid alcohol or other substances, although some do find it helpful in small intakes, in order to chill down if they're stressed up and not patient, although it's probably not the best way to achieve that state.
I find it helpful to have recently watches some high stakes action in order to have the poker feeling in me before I enter the table.
Attending the table with the attitude that you're going to crush it is also a factor that most find important, you need ambition to win. Don't make it go over your head though.
Basically the best mental state is when you're felling well physically -- you've eaten healthy, exercised, had the right amount of sleep -- and you don't have any personal issues going on in your life, but there is no right or wrong answer here, just many factor that you need to try out and find out for yourself what works.
Apologies if the answer is vague but so is the question ;) Good Luck.