Try doing the following:
Generate the ACF and PACF graphs for your data. They will give you your 'p' and 'q' values in the ARIMA model
Check your data for stationaritynon-stationarity and remove it using differencing (or any other technique). Calculate the 'd' value through this
Check your data for seasonality. Use the 'decompose' function to get a break down of the various components in your data. If seasonality exists (as it does in many cases), use SARIMA instead of ARIMA
Steps (1) and (2) will help you generate a strictly ARIMA model whereas step (3) will build a new model altogether