In object tab of properties editor goto the visibility panel and uncheck selectable. Another way to do it is in the outliner click the funnel icon on the header then click the arrow head icon. Now next to each object/collection in the outliner is an arrow head icon. Click that icon to toggle on/off selectibility. Note: Making a collection unselectable makes everything in the collection unselectable. Unless the object is in multiple collections and at least one of those collections is selectable.