Connection strings with password - secure save

Hello, I can not find any solution and i think, i’m little stupid :), but i can not find it.

My question is about best practise to store configs with connection strings, tokens etc.

How to store it savety? It is there some tool? Only i find, that gitlab patrol commits. But it is good to download code and “run”. But of somebody see the code, he see a passwors too. I’m looking for some secure solution. So i as to best practice.