How I Met Your Mother is an American sitcom that originally aired on CBS from 2005 to 2014. The series follows the main character, Ted Mosby, and his group of friends in Manhattan. Josh Radnor plays Ted Mosby, Jason Segel plays Marshall Eriksen, Cobie Smulders plays Robin Scherbatsky, and Neil Patrick Harris plays Barney Stinson.