First of all, you should check whether the setting of the treadmill is reasonable, such as whether the speed and inclination are too high. If these settings are really unreasonable, it may lead to physical discomfort and injury.
Secondly, you need to check whether your running shoes are suitable. If the shoes don't fit, it may cause foot pain and make the problem worse.
If your treadmill is set correctly, there is nothing wrong with your running shoes, which may be caused by muscle tension. At this time, the injured part can be stretched or massaged to relax muscles and accelerate recovery.
Another possibility is that it is caused by overtraining. If you suddenly increase the time and intensity of the treadmill, it may increase your risk. In this case, you can gradually increase your training time and intensity to help your body adapt to these changes.
Generally speaking, if the right foot of the treadmill hurts, measures should be taken in time to avoid serious injury. Check whether the treadmill setting is reasonable, whether the running shoes are suitable, stretch or massage the injured part, or gradually increase the training time and intensity to help your body adapt to these changes.