You can specify the RequireComponent attribute on a class that inherits from MonoBehavior and Unity will add the specified component if it is not already present when you add the script to the game object.
[RequireComponent(typeof(RigidBody))]
public class SomeBehaviorScript : MonoBehaviour
{
}