Assuming it's a grey squirrel, call your local council or a pest control company. They will set a trap for it. It's illegal to release a grey, once captured, into the wild, as they're classed as pests, so be prepared for its demise. If it's a red, you're a lucky devil, so call your local wildlife trust & they'll look after it. Unlikely to be a red in your loft, though!
Get rid of them ASAP cos they can do a lot of damage My husband has shot 25 of them on our garden We leave them in the field at the back of our house for the foxes
Could you put a bowl of water up there containing a very strong solution of Jeyes Fluid? It has a very strong pong and as many wild animals are suspicious of unpleasant smells, it might decide to vacate the premises and find somewhere more suitable. A large collection of mothballs might also have the same effect.