The CFD oilfield is located in the Bohai Sea area and is a typical offshore sandstone reservoir with strong bottom water. The characteristic of the rapid increase in water content is that it quickly enters a highly high water content period, and there currently needed to be more potential tapping measures affected by offshore production facilities. The development mode should be changed to explore the development effect of nitrogen foam flooding. This study conducted two experiments. The first experiment is a gas injection expansion experiment, which studied the changes in bubble point pressure, fluid volume, density, and viscosity under different gas injection conditions. The second experiment used a high-temperature and high-pressure oil displacement device and a long core for oil displacement experiments. Two typical sand bodies were selected for the N2 foam oil displacement experiment. The experimental results show that nitrogen injection has little effect on the properties of reservoir crude oil, with a viscosity reduction effect of 12.4% for heavy oil and 20.0% for thin oil. The viscosity of crude oil significantly impacts the selection of alternative media. The channel was prone to blockage and low oil displacement efficiency when injecting a single gas medium into a heavy oil system. The displacement efficiency of thin oil nitrogen foam is 73.28%. The displacement efficiency of nitrogen foam flooding for heavy oil is 43.09%. This study has a guiding significance for developing development plans for offshore sandstone reservoirs.