When choosing a book, the first necessary thing is to choose one you're genuinely interested in.
Literal
Book [object-を] choose time-[at-に] first necessary [attributive-な] thing [topic-は], self [subject-が] truly interest [object-を] feel book [object-を] choose [nominalizer-こと] [is-である].
A nested, multi-clause sentence with an essay-like register. The outer frame is [Xときに] まず必要なことは Y である — 'when [X], the first necessary thing is [Y].' Inside Y there's a relative clause: 自分が本当に興味を感じる ('(that) oneself truly feels interest in'), modifying 本. Then 本を選ぶこと ('to choose a book') is the nominalized final claim. 興味を感じる ('to feel interest') takes 興味 ('interest') as an を-object.