Numer of hidden layers and number of neurons

I am trying to build an LSTM model for forecasting climate data which is basically a time series data of length about 2000. I am using 80% data for training and 20% for evaluation. After this, I am trying to predict the future values. But I am getting a straight line for future values. It is not working.
I want to know how to set number of hidden layers and number of neurons. I know they are from trial and error. Due to the computational time, it takes lot of time for this. If anyone have experience, please let me know the numbers.

Check whether u have not used train_test _split for spliting.it has to split in continum.

Number of hidden layers or nodes are basically goes with the trial(as per my knowledge) or u can set keras .tuner .
Some times due to the limitation of dataset we do have straight lines as forecasting.Try getting it hrough Arima,sarima ,hotlwinter.

Thankyou for your reply.
Yes. I splitted as you said.
I should use LSTM. That’s the problem.
Any other idea how to fix this straight line prediction?