Advice: If your 'sentence' is a dependent clause, or it doesn't contain both a subject and a predicate, then it is not a proper sentence. You can often detect fragments if you read your writing backwards sentence by sentence, . from the last sentence to the first one. You can usually correct a fragment by connecting it to the sentence before or after it.
Good writers, who have a full understanding of the sentence, occasionally choose to write a sentence fragment. So you may see sentence fragments in the fiction or even some of the non-fiction you read. As an ESL student, however, you should avoid fragments (except when writing your own creative stories).