The whole letter, including the text in question, is addressed to Timothy, to instruct him in how to discharge his ministry, directly given to him by the apostle Paul. Timothy is to oversee souls, Christians of the 1st century A.D., some of whom were Jews who converted to Christ, but increasing numbers of Gentile converts were coming into fellowship.
Paul flagged up spiritual dangers he was to protect these Christians from. One such was the infiltration of profane and vain babblers trying to bring back the law of Moses (4:1-2). This is one particular way of corrupting the gospel of Christ - there are many other - but the need here is to stick to legalistic attitudes regarding marriage and eating of certain foods, as per the question.
At that time, the contemporary manifestation of creeping apostasy is detailed in this text-book about the 1st letter to Timothy as:
"...asceticism, demanded by those who subvert the gospel and deny the
faith, forbidding to marry and commanding to abstain from meats [an AV
word for 'food']. This unlawful and unevangelical celibacy and fasting
stood in the commandments of men under the influence of seducing
spirits and doctrines of devils. But God has created all things to be
received with thanksgiving of them which believe and know the truth,
according to his word." First Timothy, p 91, John Metcalfe
Christian Hebrews were told that "Marriage is honourable in all, and the bed undefiled: but whoremongers and adulterers God will judge." (Hebrews 13:4) No Christian should feel obliged to abstain from marriage due to what others tell him, or command. That is a matter of personal conscience; those who choose to marry do not sin - 1 Corinthians 7:38. Yet there were some Gnostics who felt that flesh was so corrupt, they must be ascetics. They even went so far as to deny that the Son of God could ever become human, and warnings about them appear elsewhere in the New Testament.
As for abstinence from certain foods, this could involve Mosaic dietary laws and/or fasting. However, Christians knew that they had been delivered from the law, including dietary regulations. In Romans chapter 14 they were told by Paul that
"He that eateth, eateth to the Lord, for he giveth God thanks; and he
that eateth not, to the Lord he eateth not, and giveth God thanks...
Let us not therefore judge one another any more: but judge this
rather, that no man put a stumbling-block, or an occasion to fall in
his brother's way. I know, and am persuaded by the Lord Jesus, that
there is nothing unclean of itself: but to him that esteemeth any
thing to be unclean, to him it is unclean. But if thy brother be
grieved with thy meat, now walkest thou not charitable. Destroy not
him with thy meat, for whom Christ died... For the kingdom of God is
not meat and drink, but righteousness and peace and joy in the Holy
Ghost.. For meat destroy not the work of God. All things indeed are
pure; but it is evil for that man who eateth with offence. It is good
neither to eat flesh, nor to drink wine, nor any thing whereby thy
brother stumbleth, or is offended, or is made weak. Hast thou faith?
Have it to thyself before God. Happy is he that condemneth not himself
in that thing which he alloweth. And he that doubteth is damned if he
eat, because he eateth not of faith: for whatever is not of faith is
sin." Romans 14:6, 13-15, 17, 20-23
It was the same writer of that detailed explanation about Christians employing their conscience in matters of eating and drinking who wrote to Timothy that verse in question. Now it becomes clear what he meant in 1 Timothy 4: about God providing things to be enjoyed with thanksgiving. Because Christians were no longer under the Mosaic dietary laws, the word of God and prayer had sanctified their food, and marriage was also honourable. They were not to listen to either Gnostics who condemned marriage and required fastings, or to Judaic legalists who wanted to tie them down to dietary laws. In Acts chapter 15, only drinking or eating blood remained "off the menu" (not that it ever was allowed in Jewish diets), nor were they to take up circumcision (which would bind them to the Mosaic law).
Conclusion: Those unclean foods listed in the Old Testament were only prohibited to the Jewish nation for as long as the old covenant (testament) applied. When Jesus brought in the new covenant (for both Jewish and Gentile Christians) none of the dietary laws obtained any longer, so there was no such thing as "unclean food" for them now. The only thing they would need to be careful about (so as not to stumble Jewish people from considering Christianity) was blood, or being seen eating meat that had first been presented before an idol. (Repeated in Acts 21:25) Even so, they could eat such meat if their conscience allowed them, and others were not stumbled in their faith. And Paul's further explanations as quoted in Romans chapter 14 give us the word of God on that, as confirmation and explanation.