It’s enforced by a vote in congress as to if he’s eligible or not. Being that the one time this happened outside of participation in the civil war, it was a guy in congress, his chamber voted- but I assume it would take both houses to oust a president