1st John is written by the same person who wrote the Gospel of John. He was one of Jesus’ closest followers. Like Peter, he wants to testify about what he saw and heard directly from Jesus. These chapters emphasize that there is a strong contrast between right and wrong. He refers to light and darkness multiple times and the difference between loving the world and loving God.
Some areas in life are difficult to figure out, but many have a clear right and wrong. Doing things God’s way is always the right way. Doing things God’s way will always lead to the best possible relationship with Him. When we do mess up, the best thing to do is confess it and have our relationship with God restored.