If you are needing to file a Self Assessment tax return for the first time, you will need to register with HMRC for Self Assessment. Here is the link to the registration process:-
Step by step guide to setting up a personal tax account (bksaccounts.com)
You must register by 5th October after the end of the tax year where you are required to file a tax return. For example, if you need to file a return for the year 2022/23, you will need to register by 5th October 2023.