[verb (volitional)] + と + [verb (dictionary form)] + まいと [verb (volitional)] + が + [verb (dictionary form)] + まいが [v1] [verb (volitional)] + と + [verb ます-stem] + まいと [する] しようと + するまいと / しまいと
ようと~まいと means "whether or not": the result stays the same either way. The same verb appears twice, first in the volitional form with と, then in the dictionary form with まいと. ようが~まいが is the same pattern with が, and the two are interchangeable.
A る-verb can also put the ます-stem before まい (しんじ信じまい), and する has しまい beside するまい.
The second half is a decision or a fact that won't change, and it often sounds defiant.
"Or not" can't follow a question word. "No matter what" takes ようと alone, without the まい half.
まい is a written, formal negative, so the pattern belongs in writing, speeches and firm declarations. In conversation, say ~ても~なくても.