Most visitors outside of ASEAN countries must apply for Visa on Arrival at the airport; the cost is currently IDR 500,000/person (Oct 2023). Check the information on this link if your country are accepted. The information on the link is applicable globally.
ASEAN passport holders may be exempt. Please check the information on the above link for more details.
If your country is not on the list, you must apply for a visa offshore. You can find more information from the government’s official website here.