Forecasting in intervals I have data in the interval of 5 years from 1975 to 2018 e.g. (1975-1979). (1980-1984) so on. I need to forecast the numbers in the future from 2018 to 2030 and 2040 in 5 years intervals also. what is the best method?


You don't really any some special method. Time-series data always has a frequency, for example, it could be milliseconds, minutes, hours, weeks, or years. In your case, the frequency is 5-year periods. If you have 5-year data and you need to predict next 5 years, just train a time-series model on it and it will out-of-the-box make a prediction for the 5-year periods.
The only limitation is that your data comes in predefined boxes. So if you are at time $t$ equal to the 1975-79 box, the $t+1$ would be the 1980-84 box. If for example, you would need to make a prediction for the years 1977-81, you can use linear interpolation and take the appropriate fractions from both boxes $3/5 \times x_t + 2/5 \times x_{t+1}$.
Since your data is relatively small, you should look into simple forecasting methods that work well for short time-series.
