Medical science has not figured that out, and maybe it will take them a century or more. However, the ancient yogis of India had great understanding about the origin of thoughts. Thoughts come from within and without. From within, thoughts come from the brain and the neuro-network. Yoga philosophy says that man is a tree upside down with the roots on the top. The roots are the brain network. From without, the thoughts come from the akash (sky/space). The brain and the sky interact and create thoughts for human perception. The individual soul, through its ego consciousness guided by karma, only allows a select group of thoughts into your consciousness. Why do we have to change our thoughts? Thoughts decide our life. You become what you think. If you are preoccupied with garbage thoughts, your life becomes garbage. Similarly, if you think about noble or rewarding thoughts, then life takes shape accordingly. Any thought is a limitation. The fully alert person has control over the thought process. Thought characterizes and defines you. It creates a reality. A thought leads to an action, and an action leads to success or failure. Success in life depends upon getting the right thought. Too many thoughts are a waste of energy. An intelligent person has few thoughts. An enlightened person has no thoughts. Most people have millions of thoughts and are groping in darkness. The purpose of thinking millions of thoughts is to somehow understand the nature of reality. But this is a very inefficient system. We need to think only a handful of outrageous and unlimited thoughts. We should embrace unlimited thoughts and realize them. The body needs to translate the thoughts into reality--every cell needs to embrace the reality. Thought energy is the most powerful energy at our disposal. You need to control the mind not to think useless thoughts. You should constantly check the mind and stop it from thinking useless thoughts. Even observing your thoughts can shape your consciousness. When you watch your thoughts, the thought pattern will change. You break the patterns by gaining awareness and becoming more alert. Awareness creates a spontaneous rejection of stupid thoughts or stupid actions. How do we create more awareness? If the body remains still, you immediately access more awareness. Particularly, you should keep the eyeballs still. Another way to increase awareness is by focusing on the breath. If your breathing is shallow, the mind will become calm. So attention on the breath puts attention on the mind. When a stupid thought comes in, just become alert. If you become totally alert and are fully present in the moment, then thoughts will disappear. Become aware of your skin all over the body. Become aware of your breath, and live in the moment. This will disallow the robot mode of thinking and acting.