For example, if you have monthly sales data and trained you model to predict next month based on the previous 12 values, you model could look something like this:
model = Sequential([
    LSTM(8, activation='relu', recurrent_dropout=0.15, kernel_regularizer=regularizers.l2(0.01), return_sequences=True, input_shape=(12, 1)),
    LSTM(8, activation='relu', recurrent_dropout=0.15, kernel_regularizer=regularizers.l2(0.01), return_sequences=False),
    Dense(1)])

model.compile(optimizer='adam', loss='mse')

And now you want to make a prediction for 6 months ahead. You can use a for loop making consecutive predictions:
from collections import deque

last_data = deque(x[-12:]) # slice last 12 data points from your input data

for i in range(6):
    model_input = np.array(last_data, dtype='float32')
    model_input = model_input.reshape((1, 12, 1))
    next_month = model.predict(model_input)
    print(f'Prediction for period {i}: {next_month}')
    last_data.append(next_month)
    last_data.popleft()

Or just make the last layer Dense(6) and train the model with 6 target values for each of the 6 months ahead.