absolutely its safe to buy a bitcoin if you only know how to secure it then. here are few tips i know on how to secure your investment in bitcoin; you always have to keep your wallet information a secret to yourself, also you need to know more security measures of the wallet you will use in making this investment. this are the few way i know you can keep your bitcoin safe.
In terms of wallets, you need to know which wallet is considered the best and which one should be used to store your bitcoin for the long term. All information is online, but not all information you get online is secure and the best.
Open-source wallets are the best; if you use a wallet that is closed-source, behind the code, you don't know if that phrase you are keeping secrets is also backed up somewhere by them, which, if it is, then a third party has access to your wallet.