5G communication services, which provide many benefits and advantages, require several good technical specifications for each process mechanism. A delay is still a problem in the initial access mechanism to reach the 5G communication performance specification. Significant delays can occur when finding appropriate beam alignments to obtain directional links between the Base Station (BS) and the User Equipment (UE). Solving the problem with a suitable method makes the topic is important. In this paper, we propose a new beam refinement method based on Genetic Algorithm (GA) and Particle Swarm Optimization (PSO), namely Hybrid Genetic Algorithm and Particle Swarm Optimization (HGAPSO), which this method has several advantages over GA and PSO respectively. We use the capacity parameter against the number of iterations (delay) as a performance evaluation metric, where the suitable method is determined using these parameters. The simulation results show that HGAPSO has the second-lowest number of iterations in achieving convergence with the highest capacity compared to the GA and PSO methods. From these results, we conclude that HGAPSO is a suitable method compared to GA and PSO for the initial access mechanism in mmWave 5G communication systems.