rewire

US /ˌriːˈwaɪr/
UK /ˌriːˈwaɪr/
"rewire" picture
1.

to replace the electrical wiring in a building or device

:
We need to rewire the entire house before we can sell it.
The old lamp needs to be rewired for safety.
2.

to change the way someone or something thinks or functions, often by altering fundamental patterns or connections

:
Therapy can help to rewire your brain to overcome negative thoughts.
It's difficult to rewire old habits, but it's possible with effort.