You could probably use a gun. That's a good motivator for most people that are afraid of dying. :) Otherwise, focus on YOURSELF because you can't force your friend to do what he needs to do. Motivation is something that we DO, not something that we get or give. Trust me, I've been trying to motivate my friend for 10 years and that doesn't work. Don't let his lack of motivation kill your own motivation and drive, so try not to base what you do off of what he does.
You CAN always try to trick people though, and it often works. :D So keep pushing yourself and YOU create something amazing, then show him your work. That'll either motivate him to catch up and do more with you, or it'll kill his dreams and cause him to quit school. ;)
Another option is to figure out what you both find interesting and use that interest as a means of motivation. Does he enjoy playing video games? If so, use what you're learning and get him on board with making a video game with you. Replace that with whatever interest you all have; I'm a game developer so that was the best example I could think of. lol
What have you already tried? What is his excuse (everyone has one)?
DISCLAIMER: Don't actually use a gun. lol For legal purposes, that was a joke. :D
For some people (I might be one of them) an outer frame like a college course can be counter productive.
It shifts responsibility away from you towards the education institution. 'It's in their hands now - after all I enrolled here, so there's that.'
It is not as much your own thing anymore, you start to take it less serious or even rebel against it, which is absurd since you chose it - but hey, this is not about acting logically
Its very easy show him/her html basic structure than say him/her write a code under body <h1> his/her name </h1> show him/her output he/she will think like hackerman thn show him/her more basic tag like marqee tag or show him/her navigation with simple coding
I think you should just ask him to try a few minutes or hours!
There are many tools today to easily taste the code and evaluate our behavior...
If he likes to create and has an analytical reasoning, it's playable!
first, you should make sure that he likes coding. Not everyone does what they like and sometimes that can result in them being stressed. If he does like coding, show him the beauty in coding. Let him see the results of people coding, all the website, machines and robots that are controlled by 1's and 0's. That way he will appreciate coding and thrive to be good at it.
Honestly, you can't because you must share a similar interest. He must try it and have that cherish look in his face or else... It's temporary. So.... Convince a friend to learn code or make friends by learning code😊 *cheers* *dab*