The most important thing to do is to ensure that, in the final assembly, there is no rotational degree of freedom around the axis of the bolt.
For example, I have a number of cooking pans where a single bolt holds the handle to the pan. They all repeatedly come loose and require re-tightening, because the handle can rotate slightly back and forth around the axis of the bolt. But the same can happen in arrays of multiple bolts, e.g. corners of a rectangle where sides are independent pieces, where the positions of the bolts aren't held rigidly relative to one another, allowing them all to rotate back and forth. No matter what you've done to try to prevent loosening, bolts that act as pivot points will always loosen.
To solve this, you need to have enough bolts, in the right places, to rigidly constrain the whole assembly against this. At that point, you can think about other measures to eliminate loosening from vibrations and other smaller-order effects.