The jellyfish search (JS) algorithm impersonates the foraging behavior of jellyfish in the ocean. It is a newly developed metaheuristic algorithm that solves complex and real-world optimization problems. The global exploration capability and robustness of the JS algorithm are strong, but the JS algorithm still has significant development space for solving complex optimization problems with high dimensions and multiple local optima. Therefore, in this study, an enhanced jellyfish search (EJS) algorithm is developed, and three improvements are made: (i) By adding a sine and cosine learning factors strategy, the jellyfish can learn from both random individuals and the best individual during Type B motion in the swarm to enhance optimization capability and accelerate convergence speed. (ii) By adding a local escape operator, the algorithm can skip the trap of local optimization, and thereby, can enhance the exploitation ability of the JS algorithm. (iii) By applying an opposition-based learning and quasi-opposition learning strategy, the population distribution is increased, strengthened, and more diversified, and better individuals are selected from the present and the new opposition solution to participate in the next iteration, which can enhance the solution’s quality, meanwhile, convergence speed is faster and the algorithm’s precision is increased. In addition, the performance of the developed EJS algorithm was compared with those of the incomplete improved algorithms, and some previously outstanding and advanced methods were evaluated on the CEC2019 test set as well as six examples of real engineering cases. The results demonstrate that the EJS algorithm can skip the trap of local optimization, can enhance the solution’s quality, and can increase the calculation speed. In addition, the practical engineering applications of the EJS algorithm also verify its superiority and effectiveness in solving both constrained and unconstrained optimization problems, and therefore, suggests future possible applications for solving such optimization problems.