I could not go to school, because I was ill.

I could not go to school due to illness.

Actually I want to know, how to use "because" and "due to" effectively.

Can You give me some example.

Due to repairs the garage will be closed next Saturday

Using 'due to' in this way is regarded as 'incorrect' by some.

This is because 'due' is an adjective. An adjective can only qualify a noun or
pronoun. In the above sentence, 'due' has nothing to qualify except an
implicit state of closure. It is therefore 'incorrect'.

There is another school of thought that says that 'due to' has now
acquired a prepositional sense, and so is perfectly 'correct'.

Some dictionaries take one view; some the other.

So it's the kind of thing that can appear in a test as a 'trick question'. Or a
particular teacher may be especially averse to 'due to'.

That said, 'due to' is almost universally used by native English-speakers as a
preposition. It features prominently in the tortured vocabulary of public
transport announcers, for instance:

'Due to delays, the 0653 to Waterloo is running late.'
'Due to an earlier incident, we apologise for any inconvenience to passengers.'

(Genuine examples. Don't try to understand them.)

Due to is the same as caused by. here are some examples taken from Collins dictionary:

Due to repairs the garage will be closed next Saturday.
His death was due to natural causes.
It is due to you that she is alive today.

Did I help you?
 MrPedantic's reply was promoted to an answer.