Passage
in which also going he preached to the spirits [which are] in prison,
in which also going he preached to the spirits [which are] in prison,
1 Peter 3:17 For [it is] better, if the will of God should will it, to suffer [as] well-doers than [as] evildoers;
1 Peter 3:18 for Christ indeed has once suffered for sins, [the] just for [the] unjust, that he might bring us to God; being put to death in flesh, but made alive in [the] Spirit,
1 Peter 3:19 in which also going he preached to the spirits [which are] in prison,
1 Peter 3:20 heretofore disobedient, when the longsuffering of God waited in [the] days of Noah while the ark was preparing, into which few, that is, eight souls, were saved through water:
1 Peter 3:21 which figure also now saves you, [even] baptism, not a putting away of [the] filth of flesh, but [the] demand as before God of a good conscience, by [the] resurrection of Jesus Christ,
The verse centers on "Spirit", "going", "preached", "spirits", and "prison". It is saying that the verse draws attention to "Spirit" and "going", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 18's "for Christ indeed has once suffered for..." into verse 20's "heretofore disobedient when the longsuffering of God...", so "Spirit" and "going" belong inside that flow. In 1 Peter context, the local focus is hope in suffering, holy conduct, submission, and grace.
A plain takeaway is to answer the verse's own emphasis on "Spirit" and "going" with trust shaped by these words, not by a vague optimism outside the passage.