I had a 1998 M3 that I owned and loved for over 6 years until I sold it about a year ago. In general, the car was extremely reliable. It had a mechanical failure once in that time -- a bad idle control valve -- which is amazing in retrospect. Otherwise, the electric operation of the two back doors stopped working 2 or 3 years ago, but that was not a big deal to me as I rarely used the back seats. I looked into repair but it was going to be about $300/door, so I let it slide.
By the way, I think 1999 was the last year for the E36 body style, with 2000 being the first year for the E46 body. If I'm remembering that correctly, I guess you should start by picking which body and features you prefer. Among BMW enthusiasts, the E36 is lighter and is regarded as handling slightly better I think. But, the E46 is newer, has newer technology, perhaps more safety features, etc.
In any case, I'd recommend only buying one that has had the regular, recommended services. Generally, there's a major service (Inspection I, Inspection II, etc.) every 20,000 miles. Some people don't do those, or have a local mechanic rather than a BMW dealer replace a few belts and hoses. By the way, when I traded in my M3 at 71,000 miles, the brakes were going to have to be replaced soon, the shocks and struts were on their last legs (estimate to replace: $1,600), and the clutch was in the very early stages of slipping/going (estimate: $1,600). So, your best bet is to find one that's had all service done and has as low mileage as possible. From what I understand, it's better to get an older low mileage car than a newer high mileage car.