Bitcoin custody is determined by whoever has the keys to control the bitcoin - if you aren't holding the keys, someone else is.
Hardware wallets are the most secure way to use bitcoin keys, but there are also other options like singlesig and multisig that determine what is required to spend your bitcoin.