How do you write fiction with memorable dialogue?

You cross out, delete, or otherwise remove anything that’s extraneous.

When you finish, you go back over the dialogue and mentally check that it truly does say what you want your character to say and not one single word more.

In other words, your characters speak up and then shut up.

How do I write realistic prehistoric dialogue?

So you make it up. Figure out how you think they spoke, what their accents were like, whether they talked like professors or peasants.

Which is a way of saying you go with your gut. And if your gut feeling about how they spoke and what words they used is good, then your readers will feel the same and will read their conversation as authentic.