How to file taxes if I'm not US citizen or green card holder, and permanently moved to Canada?

Hello! I’m not a US citizen or a green card holder, I lived in the US for a few years before permanently moving to Canada in May of 2022. What is the best way for me to file taxes? Do I have to do it in each country separately or only in Canada(for all of the income received in both countries)?