Optimized local basis function for Kohn-Sham density functional theory