The University of Edinburgh has an enormous number of social clubs (called societies) and sports clubs. There are over 60 sports clubs, and over 290 societies. You can find these easily through the University website: https://www.ed.ac.uk/studying/undergraduate/student-life/clubs-and-societies
Many of the sports clubs require that you hold a membership to the University gym, which is very well equipped. I didn't personally buy this, as access to the swimming pool and climbing gym were restricted at the time, but I do recommend it now that it has opened up again. Membership for one semester is about £70 (~875sek). Many sports clubs have an additional cost for their individual membership, which ranges dramatically depending on the activity (up to over a hundred pounds) and level (e.g. the snowsports club has two options, one costing £20, and the other costing £115 (https://www.eussc.com/membership)). Some clubs do not have a one semester option as well, so if you would like to join you may have to pay for the full year. There are so many options however, that you are bound to find something that works.
The societies also often have a membership cost attached, but these tend to be cheaper than the sports clubs. You are also welcome to attend a few meetings of different clubs for free to see if it is something you are interested in before paying for membership. The University website also lists the contact information for each society, and their social media, so you can see if there are any upcoming events/meetings. The societies are run through the Edinburgh University Students' Association, which you are automatically a member of if you are matriculated into the University.
I really really recommend joining at least one society, it's a really good way to meet other students.
If you are under 22, you are also entitled to free bus travel throughout the entirety of Scotland through having a Young Scots national entitlement card (https://getyournec.scot/nec/). This is a really easy way to get to different cities, or even just explore Edinburgh. For example, it takes just over an hour to drive to the neighbouring city of Glasgow using a coach (a bus). You can book these coaches through companies like megabus online (select that you have a NEC card), or just show up when it leaves.