Cough syrup has 5 different functions, and you probably don't want all 5
Acetaminophen: A painkiller with the same active ingredient as Tylenol. This is surprisingly easy to overdose on so be careful not to take any more acetaminophen.
Cough suppressant: This reduces the urge to cough, which is useful for dry coughs which do more harm than good.
Expectorant: This makes your mucus thinner so it can be coughed up more easily. If you have a lot of mucus in your lungs, you may want to cough more so mixing this with a cough suppressant is counterproductive.
Doxylamine: An antihistamine that can make people drowsy. This is only found in NyQuil and its copycats. DayQuil does not have an antihistamine.
Alcohol: Literally just booze. A very small amount (up to 10%), but it's not something people should be consuming by accident. Not all cough syrups have this so check the label.
You'll get better results if you use these things separately.
Take acetaminophen or ibuprofen as needed for pain and fever. Follow the dosing directions on the bottle (you can take both).
Take cough suppressants for DRY coughs, because they don't do much beyond give you a soar throat. Sip water to keep your throat moist.
Take expectorants for WET coughs, to get gunk out of your lungs.
Take whatever antihistamines or sleep aids work for you. This varies dramatically from person to person.