Hospitality is close to sacred in many cultures, particularly across the Middle East, South Asia, Central Asia, and much of Africa and Latin America, so treat invitations as meaningful gestures rather than casual pleasantries. Accepting, even briefly, honours the host; a flat refusal can genuinely wound in cultures where offering food is how care is expressed.
If you can attend, do. Arrive with a small gift where that is customary, expect to be fed beyond your capacity, and know that in many homes the ritual is offer, polite decline, insist, accept; your first refusal of second helpings will rarely be taken as final. Accepting at least tea or coffee and something small is the minimum courtesy almost everywhere, even during a short visit.
When you genuinely must decline an invitation, soften it: express real gratitude, give a reason, and where possible propose another time, which signals the refusal is about circumstances rather than the person. In indirect cultures, locals themselves rarely say a bare no, preferring phrases that let everyone save face, and you can borrow that style. One caution: in some cultures an enthusiastic yes given to avoid awkwardness, then a no-show, is far worse than an honest decline, so do not accept unless you intend to appear.