set up profit max problem and solve for optimal demands of labor and capital respectively. Then substitute them into the total cost function.
Total Cost = f(K,L)=f(K(w,r,p),L(w,r,p))=f(w,r,p) In this case, w=r=1. p is exogenous variable since the market is competitive.