You will owe federal income tax on the distribution in any case, no matter how you used it (except for rolling it over into another retirement account).
The question is "are you under 59 1/2?" because if you were in 2019, then you would owe an additional 10% early distribution penalty.
And while certain expenses for education are eligible to waive the 10% penalty if the distribution is from an IRA, there is no such waiver when the distribution is from a qualified plan like a 401(k) plan. See this IRS webpage.
**Say "Thanks" by clicking the thumb icon in a post**Mark the post that answers your question by clicking on "Mark as Best Answer"