You exit Canada without any check. If you have a visa that requires notation that you have left the country, you go to the Canada border office.
When I did it, the 'left the country' part required proof from the US side - either a stamp to say 'the person came to us, therefore left Canada' or enter and then exit the US. You could not just turn straight around on the bridge and reenter Canada for that purpose (visa, work permit, residency).
It turns out that the 'the person came to see us' part is actually a denial of entry to the US - do NOT do it, it will result in questions for years to come when entering the US (a friend opted to do this before I did mine, I learned from them and simply paid the $6, entered the US, wandered round the park, and then came back to Canada).
I don't know if for sightseeing this applies, I only know from the visa perspective. TBH the view from the bridge is not great, I personally wouldn't bother.