Depending on the duration and location of your exchange you may need to apply for a visa. Your host University will advise you on this and will supply any required paperwork if you do need to apply for a visa.
In most cases you will be able to apply online. However if you are going to study in the US, you should be aware that you will require to attend a personal visa appointment at the US Embassy in London or Belfast to obtain a visa.
It is your responsibility to make the arrangements for obtaining a visa and for covering the costs of your visa. This could be in the region of £200 - £300 plus travelling expenses to/from London or Belfast. You will probably receive your visa within a few days of your appointment so you will need to consider another form of ID if you are planning on taking a flight back from your visa appointment as they will hold your passport and return it to you with your visa. (In the past students have used their Driving Licence as a form of ID, but you would need to check if this will continue to be acceptable after Brexit).