What is the meaning of [a man’s got to do what a man’s got to do]

You must do what needs to be done, or what you feel ought to be done, however unpleasant it may be; sometimes used facetiously.