Lewis Hamilton says he "can do better" in terms of avoiding on-track conflict with Ferrari team-mate Charles Leclerc.