What is this part in the image?
I hope you know this part. I dont know how to search for it so that's
why im here. Any help would be appreciated.


It's a slotted LED/photodiode (or phototransistor) detector and comes in various size and shapes and is made by several well-known manufacturers.

Omron Through Beam (Fork) Photoelectric Sensor
ROHM, Through Hole Slotted Optical Switch

To name but two.