In structural dynamics control and modal identification, the different types of sensors and actuators used and their location and size generally result in different frequency response functions (FRFs) and thus affect the peak magnitude of each mode shown on the FRF curves. Consequently, this also affects the control effect for structural dynamics due to the inadequate recognition of the contributions of each mode to the structural responses. This paper presents a general method of optimizing the location and the size of various types of sensor and actuator, such as accelerometers, shakers, and force transducers as point-type sensors and actuators, and piezoceramic patches as distributed strain-type sensors and actuators for structural excitation, testing, and control. Based on the concept of controllability and observability in the control of the second order linear system, the general criterion is established considering the peak gain and the dc gain obtained based on the FRFs. Those FRFs that can be obtained by analysis or testing, when combined with the proposed objective criterion, provide a function for ranking the effectiveness of alternative sensor/actuator locations and sizes, and hence a rational basis for choosing their parameters. The method can be easily applied and has been proven to be very promising on the optimal parameter selection for both point-type and strain-type sensors and actuators. Finally, several case studies have been conducted to demonstrate the practicality of the proposed method together with experimental results.