First thing to do is to measure the space between the rear dropouts. Much older bikes might be 120, 30+-year old might be 126. Somewhere near the early 90s brought 130 mm, and most MTBs are 135 or 142 or whatever the new "Boost" and "Boost Plus" and "Only buy our parts" standards are.