Discipline is not willpower in the moment. It is a set of routines decided in advance, so that the tired, annoyed or excited version of you has fewer decisions to get wrong.
A simple routine has three parts. Before: check the calendar, look at the overall market, and list the few charts that fit your rules. During: take only those setups, at your planned size, with a stop. After: write each trade in your journal, with a note on whether you followed the plan.
Set limits that stop you on bad days. A common one is a daily loss limit: lose a set amount, say 2% or 3% of the account, and you are done until tomorrow. Another is a cap on the number of trades. Sleep, stress and anger are real inputs too. If you are not in a state to follow rules, do not trade.
Judge yourself on process, not on single results. A trade that followed your plan and lost was a good trade. A trade that broke your rules and won was a bad one that happened to pay, and it teaches the wrong lesson. Patience means most days look quiet. That is what doing it properly looks like.