To properly set up encryption keys for a software implementation, you must first determine whether you need to use symmetric or asymmetric algorithms. Symmetric algorithms require the creation of a key and an initialization vector (IV), while asymmetric algorithms require the creation of a public key and a private key. In either case, it is important to keep the key(s) secret from anyone who shouldn't decrypt your data. The IV doesn't have to be secret but should be changed for each session.
For symmetric algorithms, you can generate a key and IV using a key derivation function. For asymmetric algorithms, you can generate a public/private key pair using a cryptographic library that implements the algorithm you need.
It is also important to properly manage your keys, including storing them securely and rotating them regularly. For example, Azure services use Microsoft-managed encryption keys by default, but you can opt for customer-managed keys if you need more control.
References: