Summarize:

Unlike most file types, DAT files can be created by virtually any program; as such, you'll need to know which program created the DAT file to figure out which program to use to open it. If you don't know which program was used to create the DAT file, you'll need to figure out which program to use before you can open the DAT file. Click or double-click the app icon of the program that was used to create the DAT file. Click and drag the DAT file onto the program's window to do so. Since your Mac usually won't view the DAT file as readable, you can't typically open the DAT file by using the File > Open menu in your selected program. This will attempt to open the DAT file in your program. In some cases, you'll receive a warning that the file's contents don't match its file extension (or similar). If so, click Yes or Open to prompt the DAT file to open. For example, opening an Excel-created DAT file in Excel may result in a prompt warning you that the file may be corrupted. You can click Yes to open the file anyway. If you want to avoid having to drag the DAT file into its program every time you want to open it, you can change the file's extension. Keep in mind that you must know the exact extension used for the DAT file, as changing the extension to use even a slightly different format (e.g., MP4 instead of AVI) can result in the file breaking:  Select the DAT file. Click File, then click Get Info in the drop-down menu. Click the triangle next to the "Name & Extension" category. Uncheck the "Hide extension" box if necessary. Replace the dat extension with your file's extension in the file's current name. Press ⏎ Return, then click Use .extension when prompted (e.g., for an XLSX document, you would click Use .xlsx here).
Determine the program that created the DAT file. Open the program. Drag the DAT file into the program's window. Drop the DAT file. Confirm that you want to view the file if prompted. Change the DAT file's extension if necessary.