When a character speaks, his or her words must be put inside speech marks. This is called dialogue. It represents the actual words a person or character says (it is sometimes called 'direct speech'). Dialogue is a surprisingly convincing literary device. Why? Because we are so easily convinced by it. Characters that speak can very easily 'come alive' and 'leap off the page'.
A character's speech tells us so much about them - what they say, how they say it, and so on. Professional writers know the power of dialogue and use it well younger writers often struggle with dialogue and can use it badly.
Remember that all aspects of a story must be working towards a single end point - that is, toward the themes of the story so, dialogue must be useful and interesting if it is to be used if it is useless, it must be cut out. Characters never simply pass the time of day chatting in a story - the reader expects what characters to say to be useful to the story in some way.