If you have questions about the conjugation of казак or Russian nouns in general, you can practice and get feedback from a professional tutor.
Зря погиб в муках такой казак.
What a cossack died tortured and for nothing.