Thermal management has always been one of the leading technical challenges in high-power power modules. Especially in the current trend of seeking high power density of devices, optimized thermal design is crucial. This paper presents an optimal design method for pin-fin heatsinks for SiC power modules, based on analytical thermal models and Teaching Learning Based Optimization (TLBO) algorithm. First, the analytical thermal model of the pin-fin heatsink is introduced, which combines the Fourier-based conduction model and the empirical convection model. Junction temperature $(T_{j})$ can be directly estimated using this comprehensive model and has been verified to be within a 5% error by numerical simulations. Then, this paper investigates the effectiveness of TLBO in finding the optimal pin-fin heatsink with a compatible cold plate. Compared to Genetic Algorithm (GA) and Particle Swam Optimization algorithm (PSO), TLBO can converge more easily, taking only one-third of the convergence time with the same optimization target and constraint. This proposed optimal design methodology not only improves the power density of the converter system but also provides a valuable design method for researchers and engineers in the field.