This article explains how to temporarily and permanently disable Cortana in Windows 10. Additional information covers how to prevent Cortana from recording and storing your search habits and history.
If Cortana sometimes activates when you don't want it to, but you still want to be able to activate it manually, you'll first need to make sure Cortana isn't responding to your voice:
Select the Cortana icon (small circle) in the taskbar to open it.
Select the three vertical dots in the top left corner of the Cortana app.