1 Timothy 5 NASB
Do not lay hands upon anyone too hastily and thereby share responsibility for the sins of others; keep yourself free from sin.
Does this refer to laying on hands on the sick or ordination into ministry?
As you may remember, six principles comprise the foundation of the doctrine of Christ, and "laying on of hands" is among them:
Hebrews 6:1-2 "Therefore leaving the principles of the doctrine of Christ, let us go on unto perfection; not laying again the foundation of repentance from dead works, and of faith toward God, of the doctrine of baptisms, and of laying on of hands, and of resurrection of the dead, and of eternal judgment." KJV
Now we know that after Pentecost and the incident at Cornelius' house, there were no more instantaneous mass Spirit-baptisms: people who had not previously received the Holy Ghost would henceforth receive it through laying on of hands, which became the new norm.
For example, Phillip preached to, healed, and water-baptized virtually everyone in the city of Samaria, but the Holy Ghost never fell on the Samaritans as a group. Then Peter and John arrived from Jerusalem and began laying hands on everyone, and they all were filled with the Spirit (Acts 8:18). Paul encountered a dozen of John Baptist's disciples on the coast of Ephesus (Acts 19:1) and likewise, after he preached to them and baptized them in water, laid his hands on them individually until they were all filled with the Spirit.
Not only was the Holy Ghost given, but spiritual gifts were also imparted by the laying on of hands (1 Timothy 4:14, 2 Timothy 1:6). And of course the Gospels and the book of Acts record many healings and special blessings given through the laying on of hands by Jesus and the Apostles.
So when Paul says in 1 Timothy 5:22 (KJV), "Lay hands suddenly on no man, neither be partaker of other men’s sins," it seems to me he is telling Timothy to exercise caution and discretion in dispensing God's grace by this means. Misusing the power to heal, bless, ordain, impart gifts, and fill with the Spirit by laying hands on a person whose heart is not right in God's sight (Simon for example, in Acts 8:18-21) would amount to giving that which is holy to dogs—which Jesus warned against.