"DUE TO" modifies nouns, but introduces adjective phrases: "Her failure was due to poor study habits."
Explanation: "due to poor study habits" modifies the noun "failure." "Due to" is almost always used with a form of the verb, "be," (is, am, was, are, and were). Some say "due to" usually means "caused by."
"BECAUSE OF" modifies verbs, but introduces adverbial phrases. "She failed because of poor study habits."
Explanation: "because of poor study habits" modifies the verb "failed."
These days, people sometimes use "due to" after a verb, but when possible, keep "due to" with nouns and "because of" with verbs. Memorize DTN (due to noun) and BOV (because of verb).
If you can't remember, many experts say to use "because of" rather than "due to."
Here's a site to reinforce your learning: University of Kansas