First of all, create the prefab of the necessary turret parts from the prefabs folder.

Result of combining prefabs

Result of combining prefabs

Next, you should add the following scripts to the created prefab:

In the Turret script, we pass a game object that will rotate:

Untitled

Also we pass the projectile prefab as reference of a game object.

In the Target Finder script, we pass a game object that we use as a pivot to find targets:

Untitled

By default, target tag for a game object we want to target is Enemy.

In the child of Firing Event script, we pass a turret gun game object. For example, we use Simple Fire script:

Untitled

Next, you should add the Gun script to the turret gun prefab. It holds the muzzle object to determine transform position for instantiate projectile prefab:

Untitled

In other cases, you probably need to add some kind of animations - fire or barrel rotation scripts.