There are many ways to shoot a projectile in Unity. Most of the time you will need to resolve these questions:
"2D Shooting in Unity (Tutorial)" (21min, Sep 2018) by Brackeys. A super good overview of shooting projectiles in 2D.
"How to Make a Homing Missile" (9min, Oct 2017) by Brackeys.
"How to Make a 2D Ranged Combat System" (11min, Aug 2018) by BlackThornProd. A video of how to rotate a 2D gun to face in the direction of the mouse cursor, so it can shoot in that direction.