Hello there Sara,
The simplest way is to use some resistors and a DC power source. Resistors generate heat as R*I^2 so that is the basic principle at work here. It also helps to distribute the heat over the surface a little.
So say you want 10 watts of heating. Just for a simple example, say you have a 10v source. A 10 ohm 20 watt resistor would draw 1 amp from that 10 volt source, so the heating in watts is:
P=10*1^2=10 watts.
Say you use a 5 ohm resistor, then since Ohms Rule gives us:
I=V/R=10/5=2 then the current is 2 amps now, so we would see a greater power:
P=R*I^2=5*2^2=20 watts.
so we'd have to use a bigger size resistor that can handle 40 watts to be safe. But it helps to distribute the heat too, so we would want to use more than one resistor and have them next to each other. So say we use four resistors in series, to get a 10 ohm resistor that means we need four 2.5 ohm resistors. If we connect in parallel, we would need four 40 ohm resistors. In both cases the resistors power rating has to be two times the working power divided by the number of resistors, so we have:
Pr=10/4*2=5 watts each resistor, using four resistors for 10 watts.
It would be best to mount them under a small metal plate, and have an insulating base and maybe sides too. You can use high temperature silicone or something else that can take the temperature to glue them to the bottom of the plate, or sandwich them between the bottom and top. You may have other ideas here too.
So that should get you started to think about what is involved. It's not hard to do at all, but it may take some experimentation to find out what level of heat (10 watts, 20 watts, etc.) to keep your cup warm depending on what kind of cup it is and what the ambient temperature is and how you construct it, and also if you want to make it adjustable to lower and raise the temperature as needed.