Di- makes a verb passive. It is the mirror of me-, it never changes shape, and it keeps the root intact, which makes it the easiest affix in the language to read.
membaca ‘to read’ → dibaca ‘is read’
menulis ‘to write’ → ditulis ‘is written’
mengambil ‘to take’ → diambil ‘is taken’
Note that the root comes back whole. Menulis hides tulis; ditulis shows it.
The doer, when you need one
Surat ini ditulis oleh dia. ‘This letter was written by him.’
Oleh ‘by’ is often left out entirely, and with pronouns the language prefers to attach them:
Surat ini ditulisnya. ‘This letter was written by him.’
The part that matters
English is taught to avoid the passive. Indonesian is not, and uses it in places where English would never dream of it.
Bukunya sudah dibaca. ‘The book has been read.’ English would say “I’ve read the book”.
Nasinya dimasak dulu. ‘The rice gets cooked first.’
Ini dibikin di Bali. ‘This is made in Bali.’
An English speaker translating their own thought will produce an active sentence every time, and it will be understood, and it will sound slightly foreign. Reaching for the passive where Indonesian does is one of the fastest ways to sound less like a translation.
Where you will see it first
On signs, before you understand any of them.
Dilarang merokok. ‘Smoking forbidden.’
Dijual. ‘For sale.’
Disewakan. ‘For rent.’
Ditutup. ‘Closed.’
Every one of these is a di- passive. Once you can see the prefix, the street becomes readable.
The other di
There is a second di, the place word from A1, and it is written the same.
di Bali ‘in Bali’. Separate word, a place.
dibaca ‘is read’. Attached, a passive.
The rule is spacing: place di stands alone, passive di- is glued on. In handwriting and on signs people are not always careful, and context sorts it out.