Do read up, in the manual, and also in these forums, about the TimeWarp Tool, and (maybe better in the case you describe) “Merge Tempo from Tapping” (where you basically record a live metronome track along with your recorded music, then Cubase creates a Tempo Map based on that track, effectively lining up its tempo grid lines to the music you have already recorded).
It’s quite a vast subject, so I won’t go into further details for the moment