How we change what others think, feel, believe and do
You can gain trust (and certainly avoid losing it) by complying with social norms and following other rule systems such as company policies and national laws.
Obey rules in particular when you may be disadvantaged by not doing so.
If others do not follow rules, you can voice disagreement but beware of becoming a strident moralizer. Differentiate between major and minor transgressions and, while you should always avoid any transgression, do not turn minor transgressions of others into big issues.
A buying manager insists her people follow company policy around not accepting gifts. She also makes sure she visibly avoids this herself. She is respected for this and her people trust her in other areas too.
A person always keeps to the speed limit when driving, even if this means they will be late. If arrival time is important, they always leave in plenty of time. Passengers may moan, but they always trust this driver to be safe.
Consistently following rules has two trust-related benefits. First, it makes your actions easier to predict. We place greater trust in people who are consistent, even if we disagree with the rules they are following. Consistency also helps people understand how you think and they may admire your integrity whatever they think of your decisions.
As we watch other people, we compare what they do against all the rules and rule sets we know, and especially those we care about. We evaluate them and classify them as good or bad, foolish or clever, safe or hazardous, based on their adherence to rules (especially those which we consider to be important).
There can also be rules about rules, such as when they apply and when one rule takes priority over other rules. For example while lying is generally considered bad, it may be expected when it avoids getting others into trouble.
To gain trust, you need to visibly care a similar amount about the same things as the other person, including rules and rule sets. If their primary rule is that other rules should be applied only when they make sense, then you may gain better trust by following this principle first.
People often place higher priority on social rules over laws. They also appreciate you breaking rules to help them. If you put yourself in danger of being criticized by others in order to save me being embarrassed, then I will like and trust you much more.