(From https://minecraft.gamepedia.com/Tutorials/Installing_a_data_pack)
*Make sure you are on the Java Minecraft version, as that is the only version datapacks work with*
Here is how to install a data pack when in singleplayer:
Download the data pack. It should be a .zip file or directory.
Open Minecraft.
Select the world you want to install the data pack for, click on "Edit", then "Open world folder".
Open the folder named datapacks, and put the data pack into it.
Type /reload (if you have enabled cheats) or press F3 + T if you are in the world during the installation.
If the data pack has a correct format, it would be enabled in the world. If you have enabled cheats, you can verify by typing /datapack list enabled and find an entry named [file/your data pack file/directory name].
Here is how to install a data pack when in multiplayer:
Download the data pack. It should be a .zip file or directory.
Open your server folder, then open the folder of the world you wish to install the datapack in (default: world).
Put the data pack into a folder named datapacks
Type /reload from the console or as a level 3 operator if the server was running during the installation.
If the data pack has a correct format, it would be enabled on the server. You can verify by typing /datapack list enabled from the console or as a level 3 operator and find an entry named [file/your data pack file/directory name]