Custom model data in a recipe

Hello, I am making a datapack and as of my knowledge I can’t figure out how to have an item with custom model data to be I a recipe. For example, let’s say a recipe requires cloth and wool to make refined wool. How would I be able to make sure they are using the custom item instead of the parent item? Please help
Continue to help post