This is a great question for the novel, but it is also a quite large question. For Whom the Bell Tolls is centrally concerned with these ideas as they relate to the theme of duty and much of the book is devoted to exploring the various ways in which duty is understood, chosen, and chosen against. Through the lens of duty we can analyze Hemmingway's attitude toward war, relationships, and courage.
The most important element to understand in relation to the theme of duty is that it comes from within. Duty is almost spiritual. It grows out of a person's natural response to the world he or she lives in.
Courage, in this novel, is simply the willingness to act within one's sense of duty and affiliation. Hemingway demonstrates the nature of courage through Robert Jordan's father and grandfather who are the primary, emotional examples of the different attitudes one can take regarding one's duty.
Jordan's grandfather was a military hero who did not hide or run from his duty to his country. Jordan's father, however, commits suicide and thereby fails to do his duty. His is a coward, according to Robert Jordan. The anecdotal information presented about Jordan's father and grandfather is one way that Hemmingway expresses his attitudes on courage and human relations.
Throughout the novel, Jordan wonders if, when his moment comes, he will act as his grandfather did or as his father did. This is one of the fundamental conflicts of Hemmingway's novel. In the end, Jordan sacrifices himself in an act of duty. Hemmingway here uses war an an opportunity to do one's duty, to be courageous and to discover personal qualities/integrity.
We can expand the discussion of the internal conflict experienced by Jordan to the other characters as well. Fidelity, courage and duty are wrapped up together for all the characters.
It's possible then to say that Hemmingway's attitude toward war, human relations and courage are expressed in the idea that one must choose either to do one's duty or to run from that duty. This choice is what separates the hero from the coward, the lover from the cad, and people of character and dignity from those of lesser stuff.