Metacognition has been used in artificial intelligence to increase the level of autonomy of intelligent systems. However the design of systems with metacognitive capabilities is a difficult task due to the number and complexity of processes involved. This paper presents the CARINA architecture, which is based on precise definitions of structural and functional elements of metacognition as defined in the MISM metamodel. CARINA can be used to implement real-world cognitive agents with the capability for introspective monitoring and meta-level control. Introspective monitoring detects reasoning failure (for example, when expectation are violated). Metacognitive control selects strategies to recover from failures. The paper demonstrates a CARINA implementation of reasoning failure detection and recovery in an intelligent tutoring system called FUNPRO. The tutoring system also searches for possible explanations of a failure by searching for known explanations and by analyzing its reasoning trace.