Discipline cannot be taught, you have to do it yourself. However, there are steps and ways that can help you along the way to master discipline.
In trading, always have a trading plan. A trading plan is writing down your analysis, both technical and fundamental, and then your action to take. Next step is to execute your trading plan once it is done without making any unnessesary changes to it. Having a trading plan first also helps to reduce the emotions and psychological effects on your trading.
Other than having a trading plan, always do post mortem of your trades when you close them. Find out if you could have done better or anything wrong with your analysis, or if you did not have discipline in following your trading plan. When doing your post mortem, this is where your written trading plan comes in handy as you always have a record of your thought process and action.
P.S: All information in this post and some that follows are taken from Courtney Smith's teaching. I hope to blog it down to reinforce my learning and for sharing.