Well, I don't know anything about foreigners and their tax situation, so all I can do is say how it works for Germans in Germany with a german broker.
Bascically there are a handful of possibilites:
1. The ETF pays out all dividends -> everything is fine, your broker handles the tax payment
(this also applies to funds, which have a small amount of "ausschüttungsgleiche Erträge" but pay out enough dividens to cover for the tax, which is most of them)
2. The ETF is based in Germany -> everything is fine, your broker handles the tax payment
3. The ETF uses SWAPs and does not produce "ausschüttungsgleiche Erträge", you can look that up in the
Bundesanzeiger -> everything is fine, there are no taxes to be paid
4. The ETF is based somewhere else and has "ausschüttungsgleiche Erträge" and no or a to small amount of "ausgeschüttete Erträge" -> you need to fill out "Anlage KAP" and pay taxes yourself. Keep in mind that iShares and some other companies handle this poorly and have to be treated this way, even though they pay out dividends. Always look for a "Thesauierung" regarding your ETF in the Bundesanzeiger. The Bundesanzeiger is the one and only reliable source!
5. The ETF is based somewhere else and does not publish anything in the Bundesanzeiger -> just forget it, buy something else
//Edit:In this
thread someone pointed out, that some ETFs, which pay dividends still have a minor amount of "Thesauierung" I clearified what to look for.