Sync data and save locally

I need to create an application that shows a list through information from an API (more specifically a database), but when the user is offline, this list coming from the api needs to be saved locally. I already searched the forum, youtube and documentation, and I didn’t find anything that could help me with this, does anyone have a solution for this? obs. every time I synchronize this list I intend to delete all previous data saved locally and save the new data.