Problems with nvidea drivers on linux

I have a problem
Because my gpu is optimus based
i cannot install nvidea drivers. I am not getting performance out of my machine
If i try to install the drivers my OS breaks and i am forced to reinstall and purge the drivers
how can i disable optimus or fix this problem

Depends on your system and distro.
See this how to configure prime by hand: