Do you use commas before and after a name. For example,

If you learn your lines, Daniel, you can play the part of the grumpy old man.

Is this correct?

Yes, in this case. Commas are used to set off a name that used in direct address.

yes

where can i get some sentences i can put in commas

Yes, the use of commas before and after a name in a sentence like the one you provided is correct. Commas are used to separate the name from the rest of the sentence, indicating a pause in the spoken language. In this particular sentence, the name "Daniel" is being addressed or directly spoken to, so it is set off by commas.

To determine whether you should use commas before and after a name, you can follow a few general rules:

1. Use commas to separate a name when it is being directly addressed in a sentence, as shown in your example. Such names are often referred to as "vocative" or "direct address" names.

For example:
- "Sarah, can you hand me the book?"
- "John, don't forget about our meeting tomorrow."
- "Emily, I wanted to ask you a question."

2. If the name within the sentence is not being directly addressed, there is usually no need for commas.

For example:
- "I spoke to my friend Daniel yesterday."
- "Samuel is waiting for the mail to arrive."
- "I saw Michael at the grocery store."

Remember that the use of commas can vary depending on the sentence structure, style, and context. If you are unsure, it is always a good idea to consult a reliable grammar resource or style guide for more specific guidelines.