You need to leave the UK before your current visa expires.
If after that you wish to come back to the UK for a short visit, you will need to apply for a Standard Visitor visa. It does not matter whether your Tier 5 visa has expired or not when you apply. You need to apply outside the UK, but it can be in any country. Having applied for a visitor visa before, I assume you know the eligibility and how to apply.
I do not give immigration advice, just refer to Immigration Rules, guidance, other online content and to your sponsor to help you answer your question.