I bought myself a new DSLR few days back I tried taking pics in manual mode at night, and the built-in flash won't fire, even if I press the button to make it pop up. What might be wrong, and what can I do?
You'd have to consult your manual, but the pop-up flash probably pops up automatically only in scene modes, and possibly "A" mode. With other modes including manual, it will not pop-up automatically
If you want the flash, press the small button on the left side (which has a lightning bolt symbol).
Edit: You've indicated you have shutter speed set to 1/400. The flash sync speed of the D5200 is 1/200th, so you need a shutter speed of 1/200 or slower.
And if shutter is not firing, it's not a flash problem at all - the camera probably isn't achieving focus in the dim conditions. Does the autofocus appear to be hunting? Try switching to focusing manually and see if you can get the shutter to fire.
The internal flash should fire in A,S,P,M modes anytime you have opened it. If open, and if A,S,P,M modes, that is instruction that it should fire with the shutter, regardless. Why it might not is mysterious, sounds like a defect.
The internal flash will only automatically open and fire in Auto or Scene modes. Auto modes are automatic everything, including ISO and white balance, everything, including the flash (auto, meaning no user control).
Auto has the adjacent mode (with lightning bolt symbol with strike out line) that is Flash Off, but still Auto. Then flash will never fire in Auto. This is for places flash is inappropriate, not allowed or infeasible.
But in A,S,P,M modes, only exposure is automatic (except M, unless Auto ISO is also on). All else works only if you have turned that part on, including if the flash has been opened. You open the flash when you want to use it (in A,S,P,M).
the pop-up flash doesn't pop-up or function in manual mode because you're not supposed to use the pop-up flash in manual mode - it's called "manual" for this reason. in manual mode you're using the camera settings to adjust for lighting, not the flash. pop-up flashes are generally crappy and aren't for use in professional shots, so they're only designed to work with the camera's automatic point-and-shoot settings. if you need more light in manual mode, i'd recommend at least using an external flash with a diffuser, or at best taking a photography course to better learn how to use your camera's manual settings to adjust for lighting, and getting a tripod while you're at it. shooting in manual with a pop-up flash is like buying a ferrari and then replacing the engine with that of a ford taurus. you're doing it wrong. (;