Complex sentence: If someone points out that you made a mistake, thank him or her for telling you, and try not to make the same mistake again.
Split into simpler sentences: If someone points out that you made a mistake, thank him or her for telling you, and take it on board. If the warning is correct, accept it and try not to make the same mistake again.