In SDT the 'hit' rate is simply the proportion of trials in which the observer responded 'yes' when a target was presented. The 'false alarm' rate is the proportion of trials in which the observer responded 'yes' when no target was presented.
When computing d', the hit/FA-rates cannot be 0 or 1. In cases where this happens (e.g., due to small numbers of trials), common practice is to add/subtract 1/(2N), where N is the number of trials.
In more complex experiments (e.g., mAFC designs where the target is always presented in a random interval) the vocabulary of 'hits' and 'misses' starts to become a bit messy (though the maths still holds). If this is your situation, I strongly suggest checking out the first few chapters of the book 'Elementary SDT' by Wickens. They are very short, and spell out clearly exactly what to do and why. An excellent introductory text, and an invaluable resource when starting out.