Mapping "old" tune to grid to beatmatch / remix

Hi, so I’m trying to do a remix of an old tune where the tempo seems to change as it goes along. I realise I can chop it into bits and stretch the bits to match the layout of my new tune, but is there a more sophisticated way to do this using the grid?

Please search this forum. The question has been answered several times already. Your search terms can additionally include “tempo mapping” and “set definition from tempo”.