Find the qualities that you feel might have attracted the bad friend, and work on those. Is it your confidence? Is it your over-kindness? Is it your tendency to put others before you? Whatever it is, the quicker you accept it and begin brainstorming solutions, the better your chances are of making this experience a positive one.