Support and excavation methods have a great effect on the supporting role of the foundation pit. To investigate the effect of foundation pit with different support and excavation methods on adjacent buried hydrogen pipe, a pipe–soil coupling model was established. Deformation, strain, and stress of the pipe near the foundation pit with different support and excavation methods were analyzed. The results show that stress concentration appears on the upper and lower surfaces of the middle part of the pipe after the foundation pit excavation. The high stress areas on the upper and lower surfaces are distributed symmetrically about the pipe center. Upper surface of the pipe's middle section is pressed and the lower surface is pulled, but the strain distribution of the pipe at the pit edge is opposite. Vertical displacement of the pipe is bigger than its horizontal displacement. The underground continuous wall as the most common support structure can effectively reduce the pipe deformation. Supporting methods have different effects on buried pipe's mechanical behavior. Lateral reinforcement, inner support, and bolt support can effectively reduce the pipe deformation, but the mitigating effect of lateral reinforcement is less than inner support and bolt support. The pipe is also affected by time and space of the foundation pit excavation. The slope excavation can greatly reduce the pipe deformation, but the effects of island excavation and basin excavation are not obvious. Those results can provide references for pipe safety assessment and protection.