Competence precedes confidence. When you're actually good at putting and have put in the reps confidence will be like breathing, it will be undeniable. If you haven't put the time in and aren't actually good, your "confidence" will come and go and seem fleeting, and you'll be left wondering that you somehow "lost" your confidence, one day its there the next day its gone. That can be frustrating. If you're finding yourself lacking confidence it's because you're probably just not that good at putting, and the only way to fix that is to actually get better by practicing more.
When you're actually "good" at putting it's as undeniable as 1+1=2, you can dial it up on command. You don't need to be confident either. You're competent and that is everything. You can have feelings of self doubt but that doesn't even matter when you're good you'll just keep smashing putts and that doubt will melt away every single time.
For newer players or anyone trying to get good at putting, don't even worry about confidence. Concentrate on actually getting good at putting and practicing every day. You'll keep getting better the more reps you put in and somehow this whole "confidence" thing will come out of nowhere and it will click without even thinking about it.