Remember those in prison as you were together with them? Did you know that the Greek term used for "those in prison" - συνδεο means, (passively) be a fellow-prisoner ,(figuratively):-be bound with?
Imagine being shackled to a prisoner, you could not forget them if you tried.
Prisoners are incarcerated because they are being punished for crimes against society. Why does the Bible tell us to remember them? Not just remember, but really remember, like... I am right there with you.
These are Barnes notes on this verse. I think they are worth reading in their entirety, because believe me- anyone in prison is suffering.
"Remember them that are in bonds - All who are "bound;" whether prisoners of war; captives in dungeons; those detained in custody for trial; those who are imprisoned for righteousness' sake, or those held in slavery. The word used here will include all instances where "bonds, shackles, chains were ever used." Perhaps there is an immediate allusion to their fellow-Christians who were suffering imprisonment on account of their religion, of whom there were doubtless many at that time, but the "principle" will apply to every case of those who are imprisoned or oppressed.
The word "remember" implies more than that we are merely to "think" of them; It means that we are to remember them "with appropriate sympathy;" or as we should wish others to remember us if we were in their circumstances. That is, we are
(1) to feel deep compassion for them;
(2) we are to remember them in our prayers;
(3) we are to remember them, as far as practicable, with aid for their relief.
Christianity teaches us to sympathize with all the oppressed, the suffering, and the sad; and there are more of this class than we commonly suppose, and they have stronger claims on our sympathy than we commonly realize. In America there are not far from ten thousand ( now 2.3 million) confined in prison - the father separated from his children; the husband from his wife; the brother from his sister; and all cut off from the living world. Their fare is coarse, and their couches hard, and the ties which bound them to the living world are rudely snapped asunder. Many of them are in solitary dungeons; all of them are sad and melancholy men. True, they are there for crime; but they are men - they are our brothers. They have still the feelings of our common humanity, and many of them feel their separation from wife, and children, and home, as keenly as we would.*
*Barnes' Notes on the New Testament by Albert Barnes (Jun 30, 1962)