It’s a capacitor. Since they usually unmarked, and the one you have is broken in two, you cannot find out its original value. So you need first to find out the package by measuring the size (width and length, maybe height) and compare to a list of standard capacitor sizes. The size will constrain the voltage x capacity product (ie. for a given size, if you get a higher voltage one, it will have a lower capacity). Then you need to measure the voltage on the pins (most likely a standard voltage like 3.3, 5, 12, 24). Finally find the capacitor with the size you measured, the voltage rating directly above the one you measured (or one higher), and the highest capacity.