DSLR cameras require a decent amount of ambient lighting to be able to auto-focus. If you're at an event where it's very dark, you can do the following. Any light you can add will drastically help the auto-focus work faster and better.
Put the camera in Aperture or Manual mode.
For Nikon cameras, put camera in AF-S mode and Auto Area AF (Large rectangle).
For Canon cameras, put camera in One Shot AF and Automatic AF Point Selection (Default Mode).
Make sure there's a memory card in the camera with enough free space to store the photos.
If the camera is still not able to focus, put the camera body and lens on Manual focus and shoot in manual mode with aperture of F5.6 or greater to get everything in focus.