I took three cold tablets before going to bed.

Literal

Sleep before [time-に] cold-medicine [object-を] three-tablets drank.

風邪薬を3錠飲んだ — 錠 (じょう) is the counter for tablets/pills. 寝る前に means 'before sleeping.' A practical medical sentence.