My question is regarding the unecessary attachments. How does one stop expecting and being attached to people be it a family member or a friend? As happiest is the person who only attaches himself/herself to the Almighty and only expects from Him. But at times, one (unwillingly) gets attached to a person. How to avoid that and stop expecting from someone?

One can do this only by attaching to Allah or His messenger or Imams (as). The way out is to recite tasbeeh with full concentration at a secluded place and talking to Allah s.w.t in person and by trying to attain more concentration in namaz. Also in free time try to see the creation of Allah on internet or TV, through hubble telescope or animal planet etc. This will increase your attachment with Allah s.w.t and come out of worldly attachments InshAllah