Something like:
System: You are a helpful assistant.
User: What is the country with the largest population?
Assistant: India.
User: Ok, what is the next largest?
Assistant: China.
User: How about the next largest?
Assistant: United States.
User: And the next?
Assistant:
and the model outputs Indonesia.
But you can't just put your history in a single prompt because it would be formatted differently. If you're using a model like ChatGPT, there may be a way to copy the conversation. Otherwise, you can definitely edit the conversation (including AI responses) in the API. See https://platform.openai.com/playground for easy access, there's probably a command-line tool or alternative frontend which you can give your API key to make it easier.
But you are bound to the interface, especially if you are not running a local LLM like Llama.
Different models have different prompting syntax.