The one and only method to programmatically select elements from the Revit database is the filtered element collector. You add filters to that selecting the elements you want. The filters can check for category, class (.NET), specific properties and other things. Selecting toposurfaces is trivial: filter for the TopographySurface class:
https://www.revitapidocs.com/2022/64242f41-69e1-84be-f21b-84783e81364a.htm
This and all other questions you might run into at this level are covered in full by the Revit API getting started material, so I suggest you work through that before doing anything else:
https://thebuildingcoder.typepad.com/blog/about-the-author.html#2
Numerous sample code snippets of filtering are collected in The Building Coder samples CmdCollectorPerformance.cs module:
https://github.com/jeremytammik/the_building_coder_samples/blob/master/BuildingCoder/CmdCollectorPer...
Articles on filtering are listed in the corresponding topic group on The Building Coder:
https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.9