You can easily enable it from the Settings app. To do so, open the Settings app >> Click on Sound and Haptics >> Select Keyboard Feedback >> Turn on the toggle for Haptics.