Safari favorites disappeared on my iMac
I can't tell you where all your favourites have gone, but since you have a Time Machine backup from three weeks ago, your best bet is probably to recover them from there (as I'm guessing you haven't added a lot to your bookmarks in the past three weeks).

The file you're needing to replace is your Bookmarks.plist file. This is located in your user's Library folder. The full path is typically: Macintosh HD⁩ ▸ ⁨Users⁩ ▸ ⁨username ▸ ⁨Library⁩ ▸ ⁨Safari⁩ ▸ Bookmarks.plist

If your user's Library folder isn't visible, follow these steps to open it:


Go to Finder
Press and hold the option key while you click on the Go menu
Select Library
You can let go of the option key now
Within the Library folder open the Safari folder
Now you'll see the Bookmarks.plist file that you need to recover from your Time Machine backup




Since following the above steps has resulted in the same outcome, it's time to check whether some of your Safari settings have changed. To do this:


Go to Safari > Preferences...
Make sure you're on the General tab (first icon along top)
Now check the options for each of the following settings:


Favorites Shows: 
Top Sites Shows:

Exit Preferences
Now click on the Bookmarks menu
Double check that the Show Frequently Visited in Favorites option (second from top) is ticked


Now test again to see if this returns the previous behaviour?