Getting samples in tune can be a tricky task, especially when it comes to non melodic samples such as drum hits or sound effects.
If you find it difficult to hear the key pick a direction to transpose, and move in increments of one semitone at a time. Eventually you will land on a key that works.
You can also use a frequency analyser and use one of the lower harmonics as a guide: take a note of the frequency and see which note it corresponds to. Some EQ’s such as FabFilter Pro Q has an inbuilt keyboard making this task especially easy.
If it lands in key but sounds too high consider shifting down an octave or vice versa.