Tahe Oilfield, located in northwest China, is an unconventional fracture–vuggy carbonate reservoir. The foam-assisted nitrogen gas flooding technology has been proven to be a potential EOR technology. However, the flow behaviors of foam-assisted nitrogen gas in fracture–vuggy structures are not clear due to the complex fracture–vuggy structures and their strong heterogeneity. In this work, a three-dimensional visualized fracture–vuggy model is designed and fabricated to investigate the fluids behaviors of foam-assisted N2 flooding and classify the residual oil types after foam-assisted N2 flooding. Experimental results reveal that foam slug can enlarge the sweep efficiency, suppress the formation of nitrogen gas channeling, and detach the oil film. Additionally, the evolution processes of the gas–oil and oil–water interfaces are investigated and analyzed. Moreover, the residual oil types after foam-assisted N2 flooding and nitrogen gas flooding, respectively, are classified and summarized. Compared to nitrogen gas flooding after water flooding, 12.36% more oil can be recovered through foam-assisted N2 flooding. This work further studies the fluid flow behaviors of foam-assisted N2 in the three-dimensional visualized fracture–vuggy carbonate model and also confirms the previous achievements.