where does scrubs take place

Scrubs takes place in the fictional Sacred Heart Hospital, located in an unnamed city that is generally implied to be somewhere in California.
In real life, most of the show (seasons 1–8) was filmed at the now-demolished North Hollywood Medical Center in Los Angeles, which was dressed and renamed as Sacred Heart Hospital for production.