The first step is to have some kind of drive to do what you're doing, which you seem to have:
I want to start a martial art for physical fitness and to bring some
discipline to my daily routine
Cultivating discipline and will power is always easier when driven by some kind of inspiration.
But there is nothing that you can do before going to learn martial arts that will guarantee that you will stick it out. If you've done some other form of physical cultivation or exercise previously, and done that for some years, then this is probably the only indicator that you would have the will power and interest to continue doing something else similar.
Apart from this, your will power must be cultivated, and will be tested over time as you study. It will be tested when you have to face the inner conflict that comes up when you don't feel like training, but know that you should. And it will be cultivated when you overcome that conflict by simply going to train, despite not feeling like it, or having the desire to do some other thing that seems appealing but that will not bring you as much real benefit. (And the real test is sustained self-initiated practice, without relying on the support of a class.)
Bear in mind that this internal process is one of the major purposes of learning martial arts. And cultivating it through training yourself in the martial arts will allow it to flow into the rest of your life. To me, Gichin Funakoshi put it best when he said that karate was ultimately about "overcoming tangible and intangible obstacles". This is ultimately the same for any path by which we develop ourselves in some way, when we see the deeper purpose in it, not only the martial arts.