Indonesian writes both sounds with a plain e and gives you no accent to tell them apart. Textbooks sometimes print é to help beginners; real Indonesian never does.
The two sounds
The schwa, the vague sound in the English word “the” before a consonant. It is short and almost swallowed.
besar ‘big’ sounds like b’sar
dengan ‘with’ sounds like d’ngan
The open e, like the e in “set”.
sore ‘afternoon’
enak ‘tasty’
The pattern that helps
There is no rule that always works, but there is a strong tendency worth knowing: the schwa dominates in unstressed first syllables, and the open e is common in final syllables.
sepeda ‘bicycle’ is s’-PE-da. Schwa first, open e second. One word, both sounds.
What happens if you get it wrong
Usually nothing. Context carries you, and Indonesians are used to hearing foreigners flatten the distinction. There is one pair worth memorising though:
serang with a schwa is ‘to attack’
Serang with an open e is a city in Java
Beyond that, listen and copy. This is the one part of Indonesian pronunciation you acquire by ear rather than by rule, and it is a small price for a language that is otherwise written exactly as it is spoken.