To gain confidence / To build trust
Has two meanings: gaining personal confidence in yourself, or building trust with other people. Context clarifies which.
With practice he gradually gained confidence in himself.
It's important to gain the client's trust.
—How did she improve so much? —She gradually gained confidence.