Article 9 of the law of 15 December 1980 states that a third-country national who wishes to stay in Belgium for more than 90 days must apply for a D visa (national long-stay visa) at the Belgian diplomatic or consular post competent for their usual place of residence abroad.
The list of Belgian embassies and consulates abroad is published on the website of the FPS Foreign Affairs: www.diplomatie.belgium.be
The procedure for submitting a visa application is explained on the website of the post and/or the external service provider with which it collaborates (VFS Global, TLS Contact).
The holder of a D visa must report to the municipal administration of the place where they reside within 8 days of arrival in Belgium. Following a residence enquiry, they are registered in the register of foreign nationals and they receive a residence permit (A card).
Useful to know:
The visa does not give an absolute right of entry in the Schengen zone. Border guards may therefore refuse entry if the conditions of stay are no longer met, or if there is a risk of abuse of procedure.
The main reasons for which an authorisation to stay in Belgium for more than 90 days can be given are work, studies, a traineeship, the Working Holiday programme, or humanitarian reasons. The documents to be submitted to support an application for a D visa are detailed on this site on the 'reason for the stay' page.