He takes treats from my hands he isnt scared of my hands as I can put them around him and stroke him but then sometimes he doesnt and tries to bite but I dont put my hands near him when he is like this, he is moulting currently as well.I agree with @hrafn. Have you started target training? That is a good way t o bond with your bird. It could also help him get over the fear of hands.
Be sure that he knows you are honoring his fear by not pushing your hands too close. Apologize if you accidentally do it.
You might try holding a treat on the flat palm of your hand and sit very still, do this daily and he might start to come to you for the treat.
Thanks for the advice I understand ringnecks most times dont like being touched.Cosmo is still a young IRN, isn't he? If you are noticing resistance when there wasn't any before it could be related to maturity. As Cosmo grows 'mother's touch' becomes unwanted. Parrots reject being babied because they are maturing into receptacle adult. In some species rejection can be more fiesty. Parrotlets for example have a phase of rejecting siblings, so sometimes for their species, even bird raised together can start fighting ruthlessly.
If Cosmo has situational hand fear it is likely something you are doing that he doesn't like. Consider your hand placement in relation to Cosmo's eyeline. Are you reaching from above down toward him? Reaching too quickly? Moving your hand in a different orientation palm up vs side ways vs palm down? Deeply consider how you are moving and try to understand how Cosmo is seeing it too.
Hope this helps.