There are several ways to set up your account or ledger balances in QuickBooks Online, depending on your needs.
If you're moving from a different software, a journal entry is the cleanest way to bring everything over at once. Simply hover your mouse in the + Create button and choose Journal entry. Then, select the appropriate accounts to enter your balances.
To ensure your books remain accurate, you may also want to sync with an accountant to verify that you're using the right accounts.
If you're just adding a few accounts, you can enter their opening balances right as you create them. Explore these articles for detailed steps based on what works best for your business: