There is plenty of guidance on this topic.
1453. Shun Politics Like the Plague and be Obedient to the Government in Power
"The cardinal principle which we must follow, (in connection with your questions), is obedience to the Government prevailing in any land in which we reside. We cannot, because, say, we do not personally like a totalitarian form of government, refuse to obey it when it becomes the ruling power. Nor can we join underground Movements which are a minority agitating against the prevailing government.
"If a state of Revolution and complete chaos exists in a Country, so that it is impossible to say there is one government in power, then the friends must consult with their National or their Local Assembly, and be guided by what the Assembly considers the proper action to take; in other words which party might be best considered the legal governing authority.
"We see, therefore, that we must do two things—shun politics like the plague, and be obedient to the Government in power in the place where we reside. We cannot start judging how a particular government came into power, and therefore whether we should obey it or not. This would immediately plunge us into politics. We must obey in all cases except where a spiritual principle is involved, such as denying our Faith. For these spiritual principles we must be willing to die. What we Bahá’ís must face is the fact that society is rapidly disintegrating—so rapidly that moral issues which were clear half a century ago are now hopelessly confused, and what is more, thoroughly mixed up with battling political interests. That is why the Bahá’ís must turn all their forces into the channel of building up the Bahá’í Cause and its administration. They can neither change nor help the world in any other way at present. If they become involved in the issues the Governments of the world are struggling over, they will be lost. But if they build up the Bahá’í pattern they can offer it as a remedy when all else has failed."
(From a letter written on behalf of Shoghi Effendi to an individual believer, December 21, 1948)