T cell immunity in cancers and infectious diseases