Beginner to raycasting: making a gun

I am not new to Unity, but I am new to raycasting. I am trying to make a pistol, but have no idea where to start. Any help?

Check out this, I hope it helps.

You’ll probably be using Force and collisions. So on mouse click or button press it adds force in the direction you’re looking, if it collides with enemy/player deduct health and destroy the bullet, if it hits a wall just destroy it, if it doesnt hit anything within set amount of time destroy it

the actual gun itself is just a model.

good luck!