Bitcoin itself is majorly difficult to hacked due to the blockchain technology but your wallet can be hacked, also exchanges can be hacked too.
Security risks are more likely to come from exchanges and wallets.
To prevent your cryptocurrency being hacked, get a hard wallet and keep it somewhere safe. As its offline, it eliminates most of the chances of being hacked.