Verse 19 is only part of the full sentence. If you read from verse 18, you can see that Paul is speaking to Timothy, telling him to stay faithful.
The NIV version says it like this:
18This charge I entrust to you, Timothy, my child, in accordance with the prophecies previously made about you, that by them you may wage the good warfare, 19 holding faith and a good conscience. By rejecting this, some have made shipwreck of their faith,
having a good conscience....is basically paying attention to what your conscience is telling you in situations where there is a right thing to do and a wrong thing to do. Like deciding whether to tell the truth or lie. It's very tempting to give in sometimes to the easy choice, but if we remain committed to being loyal to God's commands, we will be able to make that right choice. And as you continue to follow and obey God, your good conscience will develop and you will know what is right and what is wrong in many more situations.
If you stop being faithful to God and quit listening to your good conscience, then your faith will be destroyed, or "shipwrecked".