Jesus spoke about the dangers of riches:
[Mar 10:23 KJV] (23) And Jesus looked round about, and saith unto his disciples, How hardly shall they that have riches enter into the kingdom of God!
When Paul speaks of the dangers, though, he at first seems to speak of the danger "out there" among the baddies that he is encountering:
[1Ti 6:6-10 ESV] (6) But godliness with contentment is great gain, (7) for we brought nothing into the world, and we cannot take anything out of the world. (8) But if we have food and clothing, with these we will be content. (9) But those who desire to be rich fall into temptation, into a snare, into many senseless and harmful desires that plunge people into ruin and destruction. (10) For the love of money is a root of all kinds of evils. It is through this craving that some have wandered away from the faith and pierced themselves with many pangs.
But Paul is warning Timothy. Paul believes he must impress upon Timothy that he must RUN! from the temptation himself because he must be faithful to his confession, THE confession by which he hopes for everlasting life:
[1Ti 6:11-16 ESV] (11) But as for you, O man of God, flee these things. Pursue righteousness, godliness, faith, love, steadfastness, gentleness. (12) Fight the good fight of the faith. Take hold of the eternal life to which you were called and about which you made the good confession in the presence of many witnesses. (13) I charge you in the presence of God, who gives life to all things, and of Christ Jesus, who in his testimony before Pontius Pilate made the good confession, (14) to keep the commandment unstained and free from reproach until the appearing of our Lord Jesus Christ, (15) which he will display at the proper time--he who is the blessed and only Sovereign, the King of kings and Lord of lords, (16) who alone has immortality, who dwells in unapproachable light, whom no one has ever seen or can see. To him be honor and eternal dominion. Amen.
To what confession is he referring?