Foundations and Applications of Trustworthy AI