1 John 4:17

By this is love perfected with us, so that we may have confidence for the day of judgment, because as he is so also are we in this world. 

We can have confidence in  day of judgment, writes John, because if we love as God loves as he is so also are we in the world.  Confidence opin the day of judgment hinges upon our relationship with God from which stems love for God and love for people.  Love then is the marker and outward evidence of our faith in God.
JFB: Herein is our love perfected, namely, in God dwelling in us, and our dwelling in God (1Jo 4: 16), involving as its result “that we can have confidence (or boldness) in the day of judgment” (so terrible to all other men, Ac 24: 25; Ro 2: 16). because, &c.– The ground of our “confidence” is, “because even as He (Christ) is, we also are in this world” (and He will not, in that day, condemn those who are like Himself), that is, we are righteous as He is righteous, especially in respect to that which is the sum of righteousness, love (1Jo 3: 14).