i want to know how to use commas in a sentence
Use commas to separate independent clauses when they are joined by any of these seven coordinating conjunctions: and, but, for, or, nor, so, yet.
Use commas after introductory a) clauses, b) phrases, or c) words that come before the main clause.
Use a pair of commas in the middle of a sentence to set off clauses, phrases, and words that are not essential to the meaning of the sentence. Use one comma before to indicate the beginning of the pause and one at the end to indicate the end of the pause.
Do not use commas to set off essential elements of the sentence, such as clauses beginning with that (relative clauses). That clauses after nouns are always essential. That clauses following a verb expressing mental action are always essential.
Use commas to separate three or more words, phrases, or clauses written in a series.
Use commas to separate two or more coordinate adjectives that describe the same noun. Be sure never to add an extra comma between the final adjective and the noun itself or to use commas with non-coordinate adjectives.
Use a comma near the end of a sentence to separate contrasted coordinate elements or to indicate a distinct pause or shift.
Use commas to set off phrases at the end of the sentence that refer back to the beginning or middle of the sentence. Such phrases are free modifiers that can be placed anywhere in the sentence without causing confusion. (If the placement of the modifier causes confusion, then it is not "free" and must remain "bound" to the word it modifies.)
Use commas to set off all geographical names, items in dates (except the month and day), addresses (except the street number and name), and titles in names.
Use a comma to shift between the main discourse and a quotation.
Use commas wherever necessary to prevent possible confusion or misreading.
More information here: