Philippians 3:7–8

Paul counts as loss everything he had, to know the Messiah

7But whatever things were gains to me, these I have considered loss because of the Messiah.

8More than that, I also consider all things to be loss because of the surpassing value of the knowledge of the Messiah Jesus my Lord, because of whom I have suffered the loss of all things, and I consider them garbage, so that I may gain the Messiah

Study it word by word

In its context

5circumcised on the eighth day, of the people of Israel, of the tribe of Benjamin, a Hebrew of Hebrews; as to the law, a Pharisee;

6as to zeal, persecuting the assembly; as to the righteousness that is in the law, having become blameless.

…

9and be found in him, not having my own righteousness that comes from the law, but that which comes through faith in the Messiah, the righteousness from God based on faith,

10to know him and the power of his resurrection and the sharing of his sufferings, being conformed to his death,

Read all of Philippians 3

Its words in the original

Following Jesus