Musashi said that one should strive to "make your fighting stance your everyday stance and your everyday stance your fighting stance." Ideally there should be no separation. If you live in
Code Yellow you are ready and relaxed and prepared for what might happen.
If you're a wildebeest or cat or a special operations soldier or a street criminal in Johannesburg or an Apache kid two hundred years ago you're already there. If you're not you need to go through a few stages first.
First, there has to be some context or setting in which you can learn. There are physical prerequisites, the presence of a teacher, the banishing of distractions so that you can learn and so on.
If your teacher is any good you will learn to access different states of awareness and consciousness. I don't want to get too woo-woo about this. It applies to everything from writing code or sex to cooking or dancing. To successfully perform an activity the mind must bring to the front the skills, tools and awareness that are appropriate to the task. Once they are developed and you can enter the "flow state" it becomes a matter of doing so seamlessly and quickly.
This is where ritual is a useful thing. Until you reach a certain level of casual competence you need a trigger which you have learned to associate with exercising those abilities. It can be as simple as a slight tug to free the pants leg or an elaborate production involving a Sacred Space, special clothes, ritualized motions, recital of a creed, invocations to the spirits and speaking a special Sacred Language.
If the ritual helps you evoke the correct state it's useful. If it becomes an end in itself or takes on more significance it can quickly become a fetish - harmless in itself but potentially counterproductive. If one never gets to the point where the skills are an unremarkable part of everyday consciousness the whole exercise has been futile in a "finger pointing at the moon" way.
Do I have a ritual before personal training or class? I suppose so. When I'm alone I shoo the dogs out of the room, take a moment to think about what I'm going to do and do that tug at the pants I mentioned earlier. In class there are ritual words "Let's start class." They are followed by a gathering in a circle and performing a brief salutation. Then the teacher says "...jurus" which is the signal to start the class the way we always do - practicing basics.