Online applications aren't allowed for all nations so you will need to check with their embassy if you can apply online. Then, you can download and complete the application form from the website of the Immigration Department of Malaysia.